contrib.admin.ModelAdmin.list_filter filter by Null ForeignKey (no clear UI to filter to show only NULL values)
|Reported by:||dkg||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Consider a model foo with a boolean field status and a Nullable foreign key named bar. Let's say we have:
class FooAdmin(admin.ModelAdmin): list_filter = ('status', 'bar')
In this event, the admin list view allows filtering on the right-hand side based on which bar element is linked. But it does not seem to allow the user to filter to show only foo items which have a NULL for bar.
I'm encountering this while running django 1.0.2-1 (as shipped in debian's python-django package). This seems like it would be a pretty commonly desired query (e.g. "show me all customers with no assigned sales agent", or "show me all students with no advisor"), so i think it would be a useful addition.
See Also: This seems similar (yet not identical) to the issue raised in #7582.