#1722 closed enhancement (wontfix)
[patch] Exclude filter for the admin
Reported by: | [530] | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Design decision needed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
class Amodel(models.Model): field = models.ManyToMany(SomeOtherModel) class Admin: list_filter = ('-field') # just like ordering
Attachments (1)
Change History (12)
comment:1 by , 19 years ago
by , 19 years ago
Attachment: | exclude_in_admin.diff added |
---|
comment:2 by , 19 years ago
priority: | high → normal |
---|
comment:3 by , 19 years ago
Summary: | Exclude filter for the admin → [patch] Exclude filter for the admin |
---|
There's a patch provided, adding [patch]
comment:5 by , 19 years ago
Instead of filtering the result in the admin it excludes, so you can get the results not matching that particular choice, foreignkey, manytomany relation.
comment:6 by , 18 years ago
Like Adrian, I had trouble figuring out what the -field
syntax actually did. The fact that neither Adrian nor I could understand what this does at first glance implies it needs a bit more thought. I'm +0 on the concept, however, so perhaps you can come up with a more obvious implementation?
comment:9 by , 18 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Triage Stage: | Unreviewed → Design decision needed |
Version: | magic-removal → SVN |
Marking as wontfix given the comments above. If someone can provide a good example of how/when this would be useful, then please reopen.
comment:10 by , 14 years ago
Easy pickings: | unset |
---|---|
Has patch: | unset |
UI/UX: | unset |
So let's say we have a Posts model, it has a field called Flag, Flag can have a tri-status: normal, sticky, and obsolete, now I show only posts other than obsolete. How can I do that easily in Django admin?
comment:11 by , 13 years ago
This can now probably be done using custom filters. However, I want to say I need something like this.
I'm doing filtering on member__options
and some of those options are don't send email (pk 42). I want to list (in the admin) all the members who *don't* belong in the don't send email-group. (So, the people I *can* send email to)
So really, having ?member__options__not=42
do it's magic would be swell.
.
Typo in example
Missing: Should also raise a not implemented error for date and booleanfields.