Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#10622 closed (fixed)

List editable breaks with model inheritance

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

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

Download all attachments as: .zip

Change History (7)

comment:1 by Julien Phalip, 15 years ago

milestone: 1.1

comment:2 by oyvind, 15 years ago

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

by Alex Gaynor, 15 years ago

Attachment: inheritance-changelist.diff added

comment:3 by Alex Gaynor, 15 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

by Alex Gaynor, 15 years ago

comment:4 by Alex Gaynor, 15 years ago

Resolution: fixed
Status: newclosed

Fixed in #10178

comment:5 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

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