Opened 19 years ago
Closed 19 years ago
#1425 closed defect (fixed)
[patch] Update "View on site" redirect handler to new model API
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | magic-removal |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The shortcut
view in [source:/django/branches/magic-removal/django/views/defaults.py django.views.defaults] is currently broken on the magic-removal branch do to using the old model API.
Attachments (2)
Change History (7)
by , 19 years ago
Attachment: | django_1425.diff added |
---|
comment:1 by , 19 years ago
Actually, I'm not sure about the parts of that patch that alter the support for relations to the Site
model. They probably shouldn't rely on the relation having a specific name...
comment:2 by , 19 years ago
Perhaps, instead of looking for an attribute called 'site'
, it could poke around in obj._meta
and look for a relation to the Site
model.
by , 19 years ago
Attachment: | django_1425.2.diff added |
---|
Updated patch that checks the target model of relations
comment:3 by , 19 years ago
Right, I've updated the patch to check whether the field.rel.to is Site
for both many-to-many and other relations. Feels a bit hackish, but hey :-P
comment:5 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch that updates the
shortcut
view for the new model API