> I have a requirement to use querysets as choices in various elements  
> of a form, and as the data grows this is clearly going to have a big  
> hit on the database every time this form is loaded.  Can anyone think  
> of a way around this?  Is there a way to cache the query set and only  
> update it every so often? Has anyone done anything similar?

You can always turn the queryset into a list and cache it with
Django's caching framework. However, that doesn't solve the usability
issue of a huge drop-down list. A few options:

1. Do what the Django raw_id_admin interface does (http://
www.djangoproject.com/documentation/model-api/#many-to-one-relationships).
It uses a popup-window in which the user sees the set of available
options (they could be paginated if it's a big list); clicking a row
results in its pk being fed back to the parent field being selected.

2. ExtJS (and possible other Javascript) libraries provide fancy AJAX
based interfaces that let you load a custom drop down list on demand
as the user scrolls down.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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