I was thinking about a similar issue when looking at Curtis's patch for an 
admin HStoreField widget [0]. It doesn't seem so nice to give 
contrib.postgres special treatment in the admin. Rather, I think the admin 
should have a hook to register custom widgets for arbitrary fields. If it 
provided that, I wonder if the autocomplete patch [1] could more easily be 
done as a third-party library.

[0] https://github.com/django/django/pull/6515
[1] https://github.com/django/django/pull/6385

On Friday, September 30, 2016 at 1:20:21 PM UTC-4, Collin Anderson wrote:
>
> Hi,
>
> "it could be possible to provide such a widget in contrib.admin".
>
> The current PR provides a django.contrib.admin.widgets.AutocompleteSelect 
> widget. Does that work?
>
> You could subclass it to use a different URL instead of the built-in 
> admin:autocomplete url if needed. My one worry is that if we end up adding 
> more code to handle use cases different from the admin, we'll just end up 
> re-inventing and maintaining django-select2. But, maybe simply re-using the 
> widget or subclassing the widget is good enough?
>
> Thanks,
> Collin
>
>
> On Wed, Sep 21, 2016 at 6:28 AM, guettli <guet...@gmail.com <javascript:>> 
> wrote:
>
>>
>>
>> Am Dienstag, 20. September 2016 13:30:33 UTC+2 schrieb Tim Graham:
>>>
>>> I haven't seen that proposal. This type of widget would be new territory 
>>> for django.forms as none of the existing widgets require JavaScript. I lean 
>>> toward keeping things that way, but I'm open to hearing counterarguments. 
>>> Historically, Django avoided "blessing" any particular JavaScript libraries.
>>>
>>
>>
>> OK, I see you don't want widgets which require JS in django core. I can 
>> understand this.
>>
>> But since contrib.admin includes the autocomplete, it could be possible 
>> to provide such a widget in contrib.admin. 
>>
>> My intention: since the admin includes JS for autocomplete, it would be 
>> nice to re-use this in custom apps.
>>
>> I know that I can use third party libraries to get this. But if it is 
>> already in contrib.admin, it would be nice to avoid duplication....
>>
>>
>>  
>>
>>> On Tuesday, September 20, 2016 at 6:51:24 AM UTC-4, guettli wrote:
>>>>
>>>> I am happy that there will be support for autocomplete in the admin in 
>>>> 1.11, if this issue/pull-request gets resolved:
>>>>
>>>> https://code.djangoproject.com/ticket/14370
>>>>
>>>> https://github.com/django/django/pull/6385/
>>>>
>>>> I looked at the changes of the docs of this pull request.
>>>>
>>>> It seems that only the contrib module "admin" gets improved.
>>>>
>>>> Is it planed to add an autocomplete widget in the django forms library?
>>>>
>>>>
>>>>
>>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-develop...@googlegroups.com <javascript:>.
>> To post to this group, send email to django-d...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-developers/a4411d55-6db2-4515-b680-0b8dfe03a3bd%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-developers/a4411d55-6db2-4515-b680-0b8dfe03a3bd%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/a578f1c5-3e1f-4cbc-bbc4-b05d4832121b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to