Opened 8 years ago

Closed 8 years ago

Last modified 5 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 Gaynor 8 years ago.
inheritance-changelist.2.diff (4.4 KB) - added by Alex Gaynor 8 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 8 years ago by Julien Phalip

milestone: 1.1
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:2 Changed 8 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 8 years ago by Alex Gaynor

Attachment: inheritance-changelist.diff added

comment:3 Changed 8 years ago by Alex Gaynor

Has patch: set
Triage Stage: UnreviewedAccepted

Changed 8 years ago by Alex Gaynor

comment:4 Changed 8 years ago by Alex Gaynor

Resolution: fixed
Status: newclosed

Fixed in #10178

comment:5 Changed 5 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

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