> Den 08/05/2015 kl. 15.15 skrev Marc Aymerich <glicer...@gmail.com>:
> 
> HI, 
> 
> I'm using atomic requests, but one of my views needs to save a model 
> regardless of wheter the current transaction rolls back or not.
> 
> I'm confused about how to proceed with the current autocommit behaviour. Do I 
> need to use a different db connection? or perhaps there is some way of 
> telling django to ignore autocommit for some particular block ? 

You need to control your transactions explicitly. Have a look at the docs: 
https://docs.djangoproject.com/en/1.8/topics/db/transactions/#controlling-transactions-explicitly
 Especially the third example code in that paragraph shows how to commit some 
queries while rolling back others.

Erik

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/93D79E32-B433-4AE8-96B7-90E839982321%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to