Re: Call a function after a model with inlines is created [solved]
On Sun, 31 Oct 2010 20:15:19 +0100, Daniel Rosemanwrote: On Oct 31, 4:46 pm, Martin Tiršel wrote: If this is only needed for the admin, you probably want to override the ModelAdmin's response_add method. This is called after the add form has been processed and all the resulting objects saved. Be sure to call (and return) the super method after you've done your processing. -- DR. Yes, this seems to be the right place, thank you. Martin -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Call a function after a model with inlines is created
On Oct 31, 4:46 pm, Martin Tiršelwrote: > Hello, > > I have two models BillingRequest and BillingRequestItem. I am using admin > and inlines, so when I am creating BillingRequest, I have some fields for > BillingRequestItems. Now, I need to send an email with some information > from both models when I create new BillingRequest record. But I don't > know, where I should put the code. It have to be after all models are > saved, but where/when is it? > > Thanks, > Martin If this is only needed for the admin, you probably want to override the ModelAdmin's response_add method. This is called after the add form has been processed and all the resulting objects saved. Be sure to call (and return) the super method after you've done your processing. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Call a function after a model with inlines is created
Hello, I have two models BillingRequest and BillingRequestItem. I am using admin and inlines, so when I am creating BillingRequest, I have some fields for BillingRequestItems. Now, I need to send an email with some information from both models when I create new BillingRequest record. But I don't know, where I should put the code. It have to be after all models are saved, but where/when is it? Thanks, Martin -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.