Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#17646 closed New feature (fixed)

Create a get_list_filter hook in ModelAdmin

Reported by: rasca Owned by: mateusgondim
Component: contrib.admin Version: dev
Severity: Normal Keywords:
Cc: rasca7@…, mmitar@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

This would be useful when for example the queryset is filtered based on a user type and the superuser can see all types. For a superuser one could add a the type field to list_display and list_filter.

Attachments (1)

ticket17646.diff (6.1 KB ) - added by mateusgondim 12 years ago.
I created the hook there in options.py and replaced it in another method that was using the property directly.i also added a doc about the new method in the index.txt of admin, and in the section of minor features in release notes.Finally, i added a test in regression tests about that.

Download all attachments as: .zip

Change History (11)

comment:1 by rasca, 13 years ago

Maybe also creating hooks for all the remaining ModelAdmin properties.

comment:2 by Julien Phalip, 13 years ago

Triage Stage: UnreviewedAccepted

comment:3 by rasca, 13 years ago

See also #17006 and #16841

comment:4 by mateusgondim, 12 years ago

Owner: changed from nobody to mateusgondim

by mateusgondim, 12 years ago

Attachment: ticket17646.diff added

I created the hook there in options.py and replaced it in another method that was using the property directly.i also added a doc about the new method in the index.txt of admin, and in the section of minor features in release notes.Finally, i added a test in regression tests about that.

comment:5 by mateusgondim, 12 years ago

Has patch: set

comment:6 by Mitar, 12 years ago

Cc: mmitar@… added

comment:7 by frecon, 12 years ago

Needs tests: set

comment:8 by frecon, 12 years ago

Needs tests: unset

comment:9 by Julien Phalip <jphalip@…>, 12 years ago

Resolution: fixed
Status: newclosed

In ae206d78f6d991e1d7ea1c1bb8bd85f4658c0877:

Fixed #17646 -- Added a get_list_filter() method to ModelAdmin. Thanks to rasca for the suggestion and to mateusgondim for the patch.

comment:10 by Julien Phalip <jphalip@…>, 12 years ago

In 22ca5bab95d65d0fdec0b6914f9ab96795cfe138:

[1.5.x] Fixed #17646 -- Added a get_list_filter() method to ModelAdmin. Thanks to rasca for the suggestion and to mateusgondim for the patch.
Backport of ae206d78f6d991e

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