Opened 11 years ago

Closed 10 years ago

#1115 closed defect (fixed)

can't update model in db if PK is not called 'id'

Reported by: Max Naude Owned by: Adrian Holovaty
Component: Core (Other) Version: 0.90
Severity: major Keywords:
Cc: ischenko@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I have model class where PK defined as this:

id = meta.IntegerField(primary_key=True, db_column='adminID')

When trying to save changes via admin interface I got an error:

OperationalError at /admin/protozeuss/adminusers/1/
(1054, "Unknown column 'id' in 'where clause'")

The SQL is clearly wrong:

'UPDATE `xxx` SET `userID`=%s,`eMail`=%s,`Line`=%s WHERE `id`=%s'

Change History (3)

comment:1 Changed 11 years ago by Max Naude

Forgot to add, this is for public release 0.90.

comment:2 Changed 11 years ago by Chris Beaven

Version: 0.9

Is this still a relevant issue?

comment:3 Changed 10 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

Seems like this has been fixed by now.

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