Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django admin: turning off DB transactions

I noticed that by default, all updates in the django admin site are done as transactions.

I need to either: - turn off transactions (globally or for a particular admin view) - inside of a save() method of an entity being saved via the admin interface, commit the transaction

The reason is that I overrode the save() method, and am notifying an external, non-django system about the change that just took place. However, the external system does not see the update since django has still not committed the transaction.

Does anyone have any suggestions on how to accomplish this?

like image 206
Krystian Cybulski Avatar asked Jun 14 '09 14:06

Krystian Cybulski


1 Answers

You can use commit_manually to get full control of a transaction in a particular view/function.

like image 168
Sergey Golovchenko Avatar answered Sep 20 '22 06:09

Sergey Golovchenko