Opened 9 years ago

Closed 9 years ago

#3332 closed (duplicate)

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

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

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 Changed 9 years ago by Gary Wilson <gary.wilson@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

duplicate of #1394.

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