Opened 19 years ago
Closed 19 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 , 19 years ago
comment:3 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Seems like this has been fixed by now.
Note:
See TracTickets
for help on using tickets.
Forgot to add, this is for public release 0.90.