Code

Opened 8 years ago

Closed 8 years ago

#1425 closed defect (fixed)

[patch] Update "View on site" redirect handler to new model API

Reported by: Christopher Lenz <cmlenz@…> Owned by: adrian
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: UI/UX:

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)

django_1425.diff (1.4 KB) - added by Christopher Lenz <cmlenz@…> 8 years ago.
Patch that updates the shortcut view for the new model API
django_1425.2.diff (2.6 KB) - added by Christopher Lenz <cmlenz@…> 8 years ago.
Updated patch that checks the target model of relations

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by Christopher Lenz <cmlenz@…>

Patch that updates the shortcut view for the new model API

comment:1 Changed 8 years ago by Christopher Lenz <cmlenz@…>

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 Changed 8 years ago by adrian

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.

Changed 8 years ago by Christopher Lenz <cmlenz@…>

Updated patch that checks the target model of relations

comment:3 Changed 8 years ago by Christopher Lenz <cmlenz@…>

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:4 Changed 8 years ago by Christopher Lenz <cmlenz@…>

The more “boring” part of this patch was included in [2475] for #1447.

comment:5 Changed 8 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

(In [2615]) magic-removal: fixed #1425 -- django.views.defaults.shortcut now works correctly (thanks, Christopher Lenz)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.