Skip to content

Commit 83c0c17

Browse files
committed
updates documentation
1 parent 9d09fae commit 83c0c17

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
root = true
44

5-
[*]
5+
[*.py]
66
indent_style = space
77
indent_size = 4
88
insert_final_newline = true

docs/fields.rst

+18-1
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,33 @@ TriggerVersionField
2828
-------------------
2929
.. class:: concurrency.fields.TriggerVersionField
3030

31+
3132
This field use a database trigger to update the version field.
3233
Using this you can control external updates (ie using tools like phpMyAdmin, pgAdmin, SQLDeveloper).
3334
The trigger is automatically created during ``syncdb()``
3435
or you can use the :ref:`triggers` management command.
3536

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+
3653
3754
.. _triggers:
3855

3956

40-
``triggers`` management command
57+
`triggers` management command
4158
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4259

4360
To easy work with |concurrency| created database triggers new command ``triggers`` is provided.

src/concurrency/triggers.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ def get_trigger_name(field):
1010
"""
1111
1212
:param field: Field instance
13-
:param opts: Options (Model._meta)
14-
:return:
13+
:return: unicode
1514
"""
1615
opts = field.model._meta
1716
return 'concurrency_{1.db_table}_{0.name}'.format(field, opts)

0 commit comments

Comments
 (0)