Thanks! The blog post was very very helpful.

In your experience, would it be better to use the
"@transaction.commit_on_success" decorator for the functions that need
it, or turn on transaction middleware for the whole app?

Thanks




On Sat, Dec 19, 2009 at 10:34 AM, Christophe Pettus <x...@thebuild.com> wrote:
>
> On Dec 18, 2009, at 9:58 PM, yummy_droid wrote:
>> I read that we can overwrite the save() for any model to do something
>> before/after its save. But my issue is, how can I be sure that what i
>> save + what the model needs to save happen as a transaction, so if
>> either fails, the whole thing fails.
>
> Django has a reasonably complete set of transaction control
> functionality.  The official documentation is at:
>
>        http://docs.djangoproject.com/en/dev/topics/db/transactions/
>
> I also wrote a blog entry about it:
>
>        
> http://thebuild.com/blog/2009/11/07/django-postgresql-and-transaction-management/
>
> (The blog entry is with regards to PostgreSQL, but it's pretty
> generally applicable.)
>
> None of it involved overriding .save(), I'm pleased to report.
>
> --
> -- Christophe Pettus
>    ...@thebuild.com
>
> --
>
> 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.
>
>
>

--

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.


Reply via email to