Opened 19 years ago
Closed 19 years ago
#1674 closed defect (fixed)
[patch] generic update_object does not handle model with pk named other than "id"
Reported by: | Owned by: | Jacob | |
---|---|---|---|
Component: | Generic views | Version: | magic-removal |
Severity: | major | Keywords: | primary_key |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If a model uses its own primary key rather than default "id" the update_object method throws an exception:
Traceback (most recent call last): File "/data/home/pmd/django/magic-removal/django/core/handlers/base.py" in get_response 74. response = callback(request, *callback_args, **callback_kwargs) File "/data/home/pmd/django/magic-removal/django/views/generic/create_update.py" in update_object 104. manipulator = model.ChangeManipulator(object.id, follow=follow) AttributeError at /leo/npc/materials/16GALNS4PC1/edit/ 'Material' object has no attribute 'id'
Attachments (1)
Change History (3)
by , 19 years ago
Attachment: | pkgenviewupd.diff added |
---|
comment:1 by , 19 years ago
Summary: | generic update_object does not handle model with pk named other than "id" → [patch] generic update_object does not handle model with pk named other than "id" |
---|
comment:2 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
This is also probably related to #1115