Opened 18 years ago

Closed 18 years ago

#3332 closed (duplicate)

field.attname should be used rather than using field.column

Reported by: annonymous Owned by: Adrian Holovaty
Component: contrib.admin Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

field.attname should be used rather than using field.column

line: 136 on django/contrib/admin/views/main.py

    def original_value(self):
        if self.original:
#            return self.original.__dict__[self.field.column]
            return self.original.__dict__[self.field.attname]

Otherwise, when "db_column" is used in primary_key field with foreign key, it will be error.

Change History (1)

comment:1 by Gary Wilson <gary.wilson@…>, 18 years ago

Resolution: duplicate
Status: newclosed

duplicate of #1394.

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