I
I
iegor2016-03-28 11:14:26
MySQL
iegor, 2016-03-28 11:14:26

How to resolve conflicts in Django?

I am using Python2.7, Django 1.8, Mysql 5.5.
It is necessary to make sure that when editing database fields through the admin panel by several people, a lock is placed on editing the field if someone is already editing it.
Found Django Concurrency, but it looks like a hack that adds an extra field to every table. I would like the database itself to resolve such conflicts. I think something like is needed , but where can I put it in the jang admin panel? select for update

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OnYourLips, 2016-03-28
@OnYourLips

I would like the database itself to resolve such conflicts.
The DBMS is not connected with a similar task. This is the application layer.

R
Rostislav Grigoriev, 2016-03-28
@crazyzubr

If you don't like django-concurrency write your app with `select ... for update` and whores.
In my opinion, a separate field for each table is a normal solution, especially since selectfoupdate locks the entire table, but you need, for example, to lock only one or a few records, but for a long time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question