Opened 19 years ago

Closed 18 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: no UI/UX: no

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 by Max Naude, 19 years ago

Forgot to add, this is for public release 0.90.

comment:2 by Chris Beaven, 19 years ago

Version: 0.9

Is this still a relevant issue?

comment:3 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

Seems like this has been fixed by now.

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