Changes between Initial Version and Version 9 of Ticket #19044


Ignore:
Timestamp:
Feb 4, 2013, 11:34:01 PM (12 years ago)
Author:
Simon Charette
Comment:

Assigning to myself since I'm planning to commit this.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19044

    • Property Easy pickings set
    • Property Needs documentation unset
    • Property Needs tests unset
    • Property Triage Stage UnreviewedReady for checkin
    • Property Summary DeletionMixin: allow substitution in success_urlAllow get_success_url to access self. object in DeletionMixin
    • Property Type UncategorizedCleanup/optimization
    • Property Version 1.4master
    • Property Owner changed from nobody to Simon Charette
    • Property Status newassigned
  • Ticket #19044 – Description

    initial v9  
    11Let's say I have object with parent set and once object is deleted, browser should be redirected to parent page.
     2
    23Expected 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
     6url(r'^object/(?P<pk>\d+)/delete/$', DeleteView.as_view(model=Object, success_url='/parent/%(parent_id)d/'), name='object_delete')
     7}}}
    58
    69This can be achieved by evaluating success_url first and then deleting object:
     10{{{
     11#!python
    712class DeletionMixin(object):
    813    """
     
    2732            raise ImproperlyConfigured(
    2833                "No URL to redirect to. Provide a success_url.")
     34}}}
Back to Top