File tree 3 files changed +20
-4
lines changed
3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
root = true
4
4
5
- [* ]
5
+ [* .py ]
6
6
indent_style = space
7
7
indent_size = 4
8
8
insert_final_newline = true
Original file line number Diff line number Diff line change @@ -28,16 +28,33 @@ TriggerVersionField
28
28
-------------------
29
29
.. class :: concurrency.fields.TriggerVersionField
30
30
31
+
31
32
This field use a database trigger to update the version field.
32
33
Using this you can control external updates (ie using tools like phpMyAdmin, pgAdmin, SQLDeveloper).
33
34
The trigger is automatically created during ``syncdb() ``
34
35
or you can use the :ref: `triggers ` management command.
35
36
37
+ ``trigger_name ``
38
+ ~~~~~~~~~~~~~~~~
39
+
40
+ .. versionadded :: 1.0
41
+
42
+ .. attribute :: TriggerVersionField.trigger_name
43
+
44
+ Starting from 1.0 you can customize the name of the trigger created.
45
+ Otherwise for each `TriggerVersionField ` will be created two triggers named:
46
+
47
+
48
+ .. code-block :: python
49
+
50
+ ' concurrency_[DBTABLENAME]_[FIELDNAME]_i' # insert trigger
51
+ ' concurrency_[DBTABLENAME]_[FIELDNAME]_u' # update trigger
52
+
36
53
37
54
.. _triggers :
38
55
39
56
40
- `` triggers ` ` management command
57
+ `triggers ` management command
41
58
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42
59
43
60
To easy work with |concurrency | created database triggers new command ``triggers `` is provided.
Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ def get_trigger_name(field):
10
10
"""
11
11
12
12
:param field: Field instance
13
- :param opts: Options (Model._meta)
14
- :return:
13
+ :return: unicode
15
14
"""
16
15
opts = field .model ._meta
17
16
return 'concurrency_{1.db_table}_{0.name}' .format (field , opts )
You can’t perform that action at this time.
0 commit comments