Allow SimpleListerFilter's lookups to be based on the available data
|Reported by:||julien||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
Shortly after SimpleListFilter landed in , there were talks on IRC with jezdez, carljm and apollo13 about allowing filter lookups to be based on the available data. Taking the DecadeBornListFilter example from the doc (http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter), you might want to only display the lookups for the decades where people were actually born in. This requires the lookups() method to have access to the ModelAdmin's queryset, somehow.
I'm attaching a patch with a suggested implementation.
Change History (5)
Changed 5 years ago by julien
comment:1 Changed 5 years ago by carljm
- Patch needs improvement set
- Triage Stage changed from Unreviewed to Accepted