#7688: newforms-admin: need mechanism for further modifying a newly saved object
after it has been saved
--------------------------------------+-------------------------------------
          Reporter:  simon            |         Owner:  nobody        
            Status:  new              |     Milestone:                
         Component:  Admin interface  |       Version:  newforms-admin
        Resolution:                   |      Keywords:                
             Stage:  Unreviewed       |     Has_patch:  0             
        Needs_docs:  0                |   Needs_tests:  0             
Needs_better_patch:  0                |  
--------------------------------------+-------------------------------------
Old description:

> ModelAdmin.save_add(...) creates a new_object and then returns an
> HttpResponseRedirect(). It would be really useful if there was a hook for
> further modifying that object after it had been saved.
>
> It's possible to do this using a custom save() method on the model at the
> moment, but that has two limitations:
>
> 1. The save() method doesn't have access to a request object. Admin
> customisations often involve extra form stuff being passed in as part of
> the request.
> 2. You might want custom behaviour that only runs on objects created
> using the admin, not objects created using other means.
>
> Having a post_save_add() method that is passed the request and the newly
> created object and does nothing by default (but can be over-ridden in
> ModelAdmin subclasses) would be one way of solving this, but I'm not sure
> it's the best way.

New description:

 ModelAdmin.save_add(...) creates a new_object and then returns an
 HttpResponseRedirect(). It would be really useful if there was a hook for
 further modifying that object after it had been saved.

 It's possible to do this using a custom save() method on the model at the
 moment, but that has two limitations:

 1. The save() method doesn't have access to a request object. Admin
 customisations often involve extra form stuff being passed in as part of
 the request.

 2. You might want custom behaviour that only runs on objects created using
 the admin, not objects created using other means.

 Having a post_save_add() method that is passed the request and the newly
 created object and does nothing by default (but can be over-ridden in
 ModelAdmin subclasses) would be one way of solving this, but I'm not sure
 it's the best way.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7688#comment:1>
Django Code <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