#14370: Adding support for Autocomplete in contrib.admin
-------------------------------------------+--------------------------------
          Reporter:  tyrion                |         Owner:  nobody      
            Status:  new                   |     Milestone:              
         Component:  django.contrib.admin  |       Version:  1.2         
        Resolution:                        |      Keywords:  autocomplete
             Stage:  Accepted              |     Has_patch:  1           
        Needs_docs:  0                     |   Needs_tests:  0           
Needs_better_patch:  0                     |  
-------------------------------------------+--------------------------------
Comment (by robhudson):

 A couple notes after trying to get this to work on an existing project...

 1. This definitely needs documentation on how to enable these widgets.  I
 took what seemed like the obvious approach and tried adding the
 `MultipleAutocompleteWidget` to an existing m2m field and got an error
 that the `__init__` takes 2 arguments and only 1 was given.  After
 perusing the source I see it takes a settings dict so I passed in an empty
 one that seemed to make it happy.  Personally I think an empty dict should
 be a default along with default settings so the user only has to override
 via:

 {{{
     formfield_overrides = {
         models.ManyToManyField: {'widget': MultipleAutocompleteWidget}
     }
 }}}

 2. It looks like the jquery-ui.min.js isn't loaded anywhere.  I get an
 error in the console that `$.widget` is not a function.  If I add jquery-
 ui to the list of inner class `Media` it moves me past this error to
 another one...

 3. `(void 0) is undefined` on line 15 of jquery-ui.js, which is the `$.ui
 = $.ui || {};` line.  This is about where I stopped.  I tried changing
 jquery-ui to load `django.jQuery` rather than `jQuery` as a test and still
 got the error.  Not sure about this one.

 Hope that feedback helps some.  I'm happy to continue trying and poking at
 this.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14370#comment:7>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to