#13953: Generic CRUD views: support for callable in  post_ACTION_redirect
----------------------------+-----------------------------------------------
 Reporter:  Alberto Donato  |       Owner:  nobody    
   Status:  new             |   Milestone:            
Component:  Generic views   |     Version:  SVN       
 Keywords:                  |       Stage:  Unreviewed
Has_patch:  1               |  
----------------------------+-----------------------------------------------
 Hi,
   the current post_save/delete_redirect mechanism doesn't allow to use
 dynamically-reversed URLs nor named ones, since it only accepts a string
 with patterns.

 The attached patch allows to use a callable as post_save/delete_redirect
 parameter, which is called with current object as parameter.
 This allows to do both simple name-based redirect and object-based ones.

 For delete view, the redirect is calculated before deleting the object,
 also providing access to current object.

 It would also be possible to pass the Request object to the callable, to
 provide greater flexibility, but IMHO doing something more than a
 reverse() in the redirect would be beyond the scope of the generic view
 usage.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13953>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to