Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#10665 closed (duplicate)

contrib.admin.ModelAdmin.list_filter filter by Null ForeignKey (no clear UI to filter to show only NULL values)

Reported by: Daniel Kahn Gillmor Owned by: nobody
Component: contrib.admin Version: 1.0
Severity: Keywords: list_filter
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: 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.

Change History (2)

comment:1 Changed 13 years ago by Karen Tracey

Resolution: duplicate
Status: newclosed

Looks like #8528.

comment:2 Changed 13 years ago by Daniel Kahn Gillmor

Yes, that looks right. Sorry that my initial searches failed to find #8528. Thanks for pointing in the right direction.

Note: See TracTickets for help on using tickets.
Back to Top