Changes between Initial Version and Version 9 of Ticket #19044


Ignore:
Timestamp:
02/04/13 23:34:01 (2 years ago)
Author:
charettes
Comment:

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

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19044

    • Property Status changed from new to assigned
    • Property Patch needs improvement unset
    • Property Needs tests unset
    • Property Summary changed from DeletionMixin: allow substitution in success_url to Allow get_success_url to access self. object in DeletionMixin
    • Property Version changed from 1.4 to master
    • Property Easy pickings set
    • Property Owner changed from nobody to charettes
    • Property Needs documentation unset
    • Property Type changed from Uncategorized to Cleanup/optimization
    • Property Triage Stage changed from Unreviewed to Ready for checkin
  • 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