Allow SimpleListerFilter's lookups to be based on the available data
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)
|Patch needs improvement: