You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Django Concurrency
12
12
13
13
django-concurrency is an optimistic lock [1]_ implementation for Django.
14
14
15
-
Tested with: 1.4.x, 1.5.x, 1.6.x, 1.7.x 1.8.x.
15
+
Supported Django versions: 1.7.x 1.8.x, 1.9rc1.
16
16
17
17
It prevents users from doing concurrent editing in Django both from UI and from a
18
18
django command.
@@ -22,15 +22,21 @@ How it works
22
22
------------
23
23
sample code::
24
24
25
+
from django.db import models
25
26
from concurrency.fields import IntegerVersionField
26
27
27
28
class ConcurrentModel( models.Model ):
28
29
version = IntegerVersionField( )
30
+
name = models.CharField(max_length=100)
29
31
30
32
Now if you try::
31
33
32
34
a = ConcurrentModel.objects.get(pk=1)
35
+
a.name = '1'
36
+
33
37
b = ConcurrentModel.objects.get(pk=1)
38
+
b.name = '2'
39
+
34
40
a.save()
35
41
b.save()
36
42
@@ -43,19 +49,18 @@ Similar projects
43
49
Other projects that handle concurrent editing are `django-optimistic-lock`_ and `django-locking`_ anyway concurrency is "a batteries included" optimistic lock management system, here some features not available elsewhere:
44
50
45
51
* can be applied to any model; not only your code (ie. django.contrib.auth.Group)
0 commit comments