Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#10622 closed (fixed)

List editable breaks with model inheritance

Reported by: oyvind Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords: list_editable inheritance
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I register a model in the adminsite that is inherited from another model with list_editable on some fields, then add a entry. When I am redirected to the change_list I get a traceback about a missing field in the form.

http://dpaste.com/18906/ - traceback

http://dpaste.com/18895/ - example app

Attachments (2)

inheritance-changelist.diff (4.4 KB) - added by Alex 5 years ago.
inheritance-changelist.2.diff (4.4 KB) - added by Alex 5 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 years ago by julien

  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 5 years ago by oyvind

In file /home/oyvind/code/django/contrib/admin/templatetags/admin_list.py

line 240, in items_for_result

    yield mark_safe(force_unicode(form[cl.model._meta.pk.attname]))

Changed to

    yield mark_safe(force_unicode(form[cl.model._meta.pk.name]))

name is used here:

http://code.djangoproject.com/browser/django/trunk/django/forms/models.py#L444

Changed 5 years ago by Alex

comment:3 Changed 5 years ago by Alex

  • Has patch set
  • Triage Stage changed from Unreviewed to Accepted

Changed 5 years ago by Alex

comment:4 Changed 5 years ago by Alex

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

Fixed in #10178

comment:5 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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.