Opened 18 years ago
Closed 18 years ago
#2718 closed defect (duplicate)
filters in auth.models not visible in admin-interface
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
filters defined in auth.models User don´t show up in admin-interface
Change History (8)
comment:1 by , 18 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 18 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
in auth.models User:
list_filter = ('is_staff', 'is_superuser', 'is_active')
none of these filters show up in the admin-interface. I´m on the latest revision.
I have filters in other models and they work fine.
comment:3 by , 18 years ago
Resolution: | → worksforme |
---|---|
Status: | reopened → closed |
Works for me...I'm not sure why it wouldn't be working for you. Maybe try a fresh installation?
comment:4 by , 18 years ago
just did a fresh installation. however, it´s not that important. btw, I´m using OneToOne for extending the user with a user-profile. not sure if that can cause the problem.
comment:5 by , 18 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
when you extend the user with a one-to-one userprofile, the filters don´t show up anymore (using the revision 3896)
comment:6 by , 18 years ago
This problem still exists. Even if I don't have a OneToOne field, I still cannot filter using some foreign keys. If I apply following patch, it works well.
-
django/contrib/admin/views/main.py
573 573 574 574 def get_filters(self, request): 575 575 filter_specs = [] 576 if self.lookup_opts.admin.list_filter and not self.opts.one_to_one_field:576 if self.lookup_opts.admin.list_filter: 577 577 filter_fields = [self.lookup_opts.get_field(field_name) \ 578 578 for field_name in self.lookup_opts.admin.list_filter] 579 579 for f in filter_fields:
The other peculiar thing is that when I try and construct an instance of the model from the interactive shell, ._meta.one_to_one_field is None and the condition should not affect it... I somebody can tell me where to look, if not I can try and digg it out myself.
comment:7 by , 18 years ago
Same for me. Suddenly all my filters disappeared and I did not realized that was because I've used
OneToOne field. Thank you for this patch! :)
comment:8 by , 18 years ago
Resolution: | → duplicate |
---|---|
Status: | reopened → closed |
I believe this is duplicate to ticket:2145. Ticket:2145 provides same solution in same place for the same problem.
Please reopen this with more information; I'm not sure what you mean.