Hi,

for the Admin Interface there is raw_id_fields.

In the code of my application I use my ButtonWidget.
It renders itself as a hidden Input field and a button. If you
click on the button you get a query page to search for the related
object. After selection it writes the value back to the hidden field
with JS opener.document.getElementById(...);

That's my way, I guess there exist better solutions.

  Thomas

PNM schrieb:
> Before I re-invent the wheel: is there any generally accepted or
> recommended generic way to handle ModelChoiceFields with very large
> datasets in Django?
> 
> My current example is an address>post/ZIP-code relationship where
> Django's automatic field creation pulls in the whole postcode table
> with thousands of rows into a ModelChoiceField.
> 
> The postcode field changes relatively seldom, so a sensible solution
> would seem to be some sort of passive display-only field which mirrors
> the choice field's functionality (show the link's __unicode__ and hold
> the link's pk for form validation), and that the mechanism for pulling
> in a new value is put somewhere else (eg. a button to open a search-
> and-select window). A ModelLookupField?
> 
> This must be such a common scenario that I'd be interested in hearing
> how other people solve it. I can't find anything in the documenation
> on it.

-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to