On Wed, Apr 8, 2009 at 1:43 PM, Garth <[email protected]> wrote:
>
> I have noticed that admin forms where it is possible to select from a
> list for a related entity (specified by a foreign key) take a long
> time to load if the related entity has more than a few hundred rows.
> Is this a problem that others have encountered? Are there alternate
> select widgets or other approaches that you have taken to solve this
> problem? I was thinking of creating a widget that could make an ajax
> request and fill in the select (maybe using dojo's select) as the user
> types. Any ideas?

Does Django have a solution for the "lots of related objects takes a
while to load" problem? Yes - look for the raw_id_fields option in
ModelAdmin.

Is it possible to replace the Django default widget with a different
widget? Yes.

Are there existing widgets/instructions on how to do this? Yes. Here's one:

http://jannisleidel.com/2008/11/autocomplete-form-widget-foreignkey-model-fields/

Is there one for Dojo? Yes - there's one in Django's wiki:

http://code.djangoproject.com/wiki/AJAXWidgetComboBox

There are sure to be lots of others around the place. Google is your
friend in this case.

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to