Add title option for admin filter when providing a field name
The generated title for admin filters when the field is on a related model is often times confusing and not usable since it will be the name of the field without any reference to the fact that it's on a related model instead of the main model. When the field has the same name as a field on the main model it appears as a duplicate as far as the user can tell.
This patch expands the existing tuple pattern for a list_filter
item to allow the second parameter to be a string which will be used as the title, instead of only allowing a class inheriting from FieldListFilter
. This dove-tails nicely with the existing functionality as providing a subclass of FieldListFilter
allows you to easily provide a title on the class itself, but the ability to provide just a string to use as a title removes the need to subclass the correct class choice for the field type (which is fragile) and streamlines the process for when you only want to change the title.
Change History
(5)
Triage Stage: |
Unreviewed → Accepted
|
Patch needs improvement: |
set
|
Owner: |
changed from nobody to pdecol
|
Status: |
new → assigned
|
Patch needs improvement: |
unset
|
Resolution: |
→ wontfix
|
Status: |
assigned → closed
|
Triage Stage: |
Accepted → Unreviewed
|
PR