#7982 closed (fixed)
ModelAdmin primarykeys
Reported by: | sorl | Owned by: | sebastian.hillig |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
A models primary keys used with ModelAdmin cannot end with: add, history nor delete. See call method of ModelAdmin in options.py, url scheme probably needs to be changed to fix this.
Attachments (2)
Change History (11)
comment:1 by , 16 years ago
Component: | Uncategorized → Admin interface |
---|
comment:2 by , 16 years ago
Has patch: | set |
---|
comment:3 by , 16 years ago
Has patch: | unset |
---|---|
milestone: | → 1.0 maybe |
Owner: | changed from | to
Status: | new → assigned |
Triage Stage: | Unreviewed → Design decision needed |
Having looked into this again, i guess one would either have to decouple the actions from the model url or run into those problems over and over again using a char primary key because of those reserved words, or prefix all specific object requests with something like model/objects/pk.
(ignore the patch, wasn't recognizing the real problem)
comment:4 by , 16 years ago
milestone: | 1.0 maybe → 1.0 |
---|---|
Triage Stage: | Design decision needed → Accepted |
(deleted patch just so that I don't get confused.)
comment:5 by , 16 years ago
Has patch: | set |
---|
The patch changes the url-schema of the admin as following:
app/model/ # No view -> redirects to objects/ (maybe a future "choose your view/manager?")
app/model/objects/ # List view
app/model/objects/pk # Particular object
app/model/objects/pk/action # Action on particular object, history/delete
app/model/add/ # Create a new object
Currently has one left issue, which is marked as a TODO in the ticket, saving an already existing model with saveandnew currently doesn't get the right url (wish i had an admin urlconf to make this patch somewhat nicer).
follow-up: 7 comment:6 by , 16 years ago
I don't like this patch right now. It introduces a backward incompatibility in the admin URL schema. This ticket is really a duplicate of #6470, but it was renamed to be the correct fix. The delete and history case and be easily fixed, but the add case is going to be nearly impossible in any case.
by , 16 years ago
Attachment: | 7982_against_trunk.diff added |
---|
Patch, doesn't fix /add/ but the other two cases, adds test for all three
comment:8 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Woops, kinda didn't fix it ... looking through it again :P