Changes between Initial Version and Version 9 of Ticket #19044
- Timestamp:
- Feb 4, 2013, 11:34:01 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #19044
- Property Easy pickings set
- Property Needs documentation unset
- Property Needs tests unset
- Property Triage Stage Unreviewed → Ready for checkin
- Property Summary DeletionMixin: allow substitution in success_url → Allow get_success_url to access self. object in DeletionMixin
- Property Type Uncategorized → Cleanup/optimization
- Property Version 1.4 → master
- Property Owner changed from to
- Property Status new → assigned
-
Ticket #19044 – Description
initial v9 1 1 Let's say I have object with parent set and once object is deleted, browser should be redirected to parent page. 2 2 3 Expected way to work is: 3 url(r'^object/(?P<pk>\d+)/delete/$', DeleteView.as_view(model=Object, success_url='/parent/%(parent_id)d/'), name='object_delete'), 4 4 {{{ 5 #!python 6 url(r'^object/(?P<pk>\d+)/delete/$', DeleteView.as_view(model=Object, success_url='/parent/%(parent_id)d/'), name='object_delete') 7 }}} 5 8 6 9 This can be achieved by evaluating success_url first and then deleting object: 10 {{{ 11 #!python 7 12 class DeletionMixin(object): 8 13 """ … … 27 32 raise ImproperlyConfigured( 28 33 "No URL to redirect to. Provide a success_url.") 34 }}}