Django admin: shutting down database transactions

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

I need to: - disable transactions (globally or for a specific administrator) - make a transaction inside the save () method of an object saved through the admin interface

The reason is that I redefined the save () method and notify the non-django external system of the change. However, the external system does not see the update because django has not yet completed the transaction.

Does anyone have any suggestions on how to do this?

+4
source share
3 answers

You can use commit_manually to get full control over a transaction in a specific view / function.

+5
source

A better solution would be to investigate database transaction isolation settings, as this is the real reason why an external process cannot β€œsee” the update ...

0
source

Source: https://habr.com/ru/post/1286193/


All Articles