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
    [email protected]

--

You received this message because you are subscribed to the Google Groups 
"Django users" 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-users?hl=en.


Reply via email to