Code

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4009 closed (duplicate)

Model validator does not allow parent fields for Admin list_filter

Reported by: simon@… Owned by: adrian
Component: Validators Version: master
Severity: Keywords: Admin list_filter model inheritance validator
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Admin list_filter doesn't seem to recognise fields inherited from a model's base class.

Here is a patch which fixes that, along the same lines as list_display.

NOTE, this patch also includes another one called list_filter.diff, which allows related fields in list_filter.

BTW, my two cents worth on model inheritance is 'keep it simple'. Do nothing with database views/relations etc unless specified. Obviously those features would be great but aren't suitable for all cases.

Attachments (1)

admin_list_filter.diff (2.0 KB) - added by simon@… 7 years ago.

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by simon@…

comment:1 Changed 7 years ago by simon@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

OK I got this far then found Admin flatly doesn't like inherited models anyway. I guess there might be a way to fix this at a lower level, so inherited fields are recognised the same as locally declared ones, but I don't have time right now :-|

comment:2 Changed 7 years ago by ubernostrum

  • Resolution set to duplicate
  • Status changed from new to closed

Well, the specific root of this problem is that Django does not currently support model inheritance; anything which works is largely an accident at this point, though it is slated to be worked out before 1.0.

comment:3 Changed 7 years ago by ubernostrum

(duplicate of #1656)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.