Skip to content

Commit

Permalink
updates documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
saxix committed Nov 3, 2015
1 parent 9d09fae commit 83c0c17
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

root = true

[*]
[*.py]
indent_style = space
indent_size = 4
insert_final_newline = true
Expand Down
19 changes: 18 additions & 1 deletion docs/fields.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,33 @@ TriggerVersionField
-------------------
.. class:: concurrency.fields.TriggerVersionField


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

``trigger_name``
~~~~~~~~~~~~~~~~

.. versionadded:: 1.0

.. attribute:: TriggerVersionField.trigger_name

Starting from 1.0 you can customize the name of the trigger created.
Otherwise for each `TriggerVersionField` will be created two triggers named:


.. code-block:: python
'concurrency_[DBTABLENAME]_[FIELDNAME]_i' # insert trigger
'concurrency_[DBTABLENAME]_[FIELDNAME]_u' # update trigger
.. _triggers:


``triggers`` management command
`triggers` management command
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To easy work with |concurrency| created database triggers new command ``triggers`` is provided.
Expand Down
3 changes: 1 addition & 2 deletions src/concurrency/triggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ def get_trigger_name(field):
"""
:param field: Field instance
:param opts: Options (Model._meta)
:return:
:return: unicode
"""
opts = field.model._meta
return 'concurrency_{1.db_table}_{0.name}'.format(field, opts)
Expand Down

0 comments on commit 83c0c17

Please sign in to comment.