Hi, On Jun 30, 1:49 pm, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > Is it possible to add sorting criteria for a foreign key <select> widget > in the oldforms admin? (Django 0.96) > > I've got a foreign-key list with several thousand members, and it can be > difficult to find the appropriate item to link to in the drop-box. It > is particularly difficult when new items are added and some get inserted > in the middle of the list rather than at the end. Setting `ordering = > ['field-name']` on the model for the table pointed to by the foreign key > doesn't seem to affect its presentation in the referring table's admin > page.
If your list has thousands of members, it's not a good idea to leave it as a drop down list as it's performance will only get worse as more members are added into it. Instead, consider using the parameter "raw_id_admin" on that field: http://www.djangoproject.com/documentation/0.96/model-api/#relationships This way, your users will get a popup list of those member records which they can sort by any field that is displayed in that admin change list (you can even set the default field ordering for that list page.) -Rajesh D --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---