#5833: Custom FilterSpecs -------------------------------------------+-------------------------------- Reporter: Honza_Kral | Owner: jkocherhans Status: assigned | Milestone: Component: django.contrib.admin | Version: SVN Resolution: | Keywords: nfa-someday list_filter filterspec nfa-changelist ep2008 Stage: Accepted | Has_patch: 1 Needs_docs: 1 | Needs_tests: 1 Needs_better_patch: 0 | -------------------------------------------+-------------------------------- Comment (by subsume):
Multiple filter specs won't become a problem until this feature is implemented. Right now, list_filter only accepts fields on the model in question. With this proposal FilterSpecs will now be opened up to conduct querying on related fields. Concrete example: Take a situation where you have Person and related to it is a StaffContact. You have Person registered in Admin and you create two FilterSpecs, one called 'Contacted by' (which looks at the user field of StaffContact) and another called 'Contact range' (which looks at the field of StaffContact). Using these two fields together based on this implementation, chained fields can't give you all Person objects who were contacted by BOTH a particular staff person AND a particular date range, which might very well be preferable. Two JOINs will be created by this proposal, whereas you may have wanted one. -- Ticket URL: <http://code.djangoproject.com/ticket/5833#comment:76> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.