List Info

Thread: Filters on Foreign Key select boxes




Filters on Foreign Key select boxes
user name
2006-10-31 10:03:58
Hi
I was wondering about this. Is it possible to apply filters
in prebuilt
admin application so that we can filter out the contents of
the select
boxes from foreign keys, using a criteria defined by the
user (a
text-pattern based match should be sufficient)?

Example

class Airplane(...)
    name = ...
    manufacturer = models.ForeignKey(Manufacturer)

    class Admin:
        ....

class Manufacturer
    name= ...
    blah blah ...

With the above schema, I have in the Airplane admin a select
box with
all the manufacturers to choose from. But what if the
Manufacturer list
grows in size and the user must choose between hundreds of
manufacturers? Is there a way to filter them out without
rewriting
entire parts of admin apps?

Thank you


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )