Skip to content

Commit 491b761

Browse files
committed
Merge branch 'release/1.4'
* release/1.4: (24 commits) updates CHANGES fixes py3.4 tests enable ConcurrentModelAdmin.check only on django>=1.11 closes issue #81 removes some doctests minor tests cleanup fixes wrong import some code clean, removes old compatibility related code updates docs updates docs fixes docs pagination add test for issue #54 (just asa reference) updates CHANGES fixes issue #80 Fix warnings on django 1.11 with Python 3.6 -Wall updates docs updates tests removes unused tests requirements removes double requirement in testing pep8 and minor updates ...
2 parents ff45e55 + 38102cb commit 491b761

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+571
-271
lines changed

.travis.yml

Lines changed: 25 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
language: python
22
sudo: false
33
python:
4+
- 2.7
5+
- 3.4
46
- 3.5
7+
- 3.6
8+
59

610
cache:
711
directories:
@@ -12,58 +16,43 @@ services:
1216
- PostgreSQL
1317

1418
env:
15-
- TOXENV=py27-d18-pg
16-
- TOXENV=py27-d18-sqlite
17-
- TOXENV=py27-d18-mysql
18-
- TOXENV=py27-d19-pg
19-
- TOXENV=py27-d19-sqlite
20-
- TOXENV=py27-d19-mysql
21-
- TOXENV=py27-d110-pg
22-
- TOXENV=py27-d110-sqlite
23-
- TOXENV=py27-d110-mysql
24-
- TOXENV=py27-d111-pg
25-
- TOXENV=py27-d111-sqlite
26-
- TOXENV=py27-d111-mysql
27-
28-
- TOXENV=py33-d18-pg
29-
- TOXENV=py33-d18-sqlite
30-
31-
- TOXENV=py34-d18-pg
32-
- TOXENV=py34-d18-sqlite
33-
- TOXENV=py34-d19-pg
34-
- TOXENV=py34-d19-sqlite
19+
- DJANGO=1.8 DB=pg
20+
- DJANGO=1.9 DB=pg
21+
- DJANGO=1.10 DB=pg
22+
- DJANGO=1.11 DB=pg
3523

36-
- TOXENV=py35-d18-pg
37-
- TOXENV=py35-d18-sqlite
38-
- TOXENV=py35-d19-pg
39-
- TOXENV=py35-d19-sqlite
40-
- TOXENV=py35-d110-pg
41-
- TOXENV=py35-d110-sqlite
42-
- TOXENV=py35-d111-pg
43-
- TOXENV=py35-d111-sqlite
24+
- DJANGO=1.8 DB=mysql
25+
- DJANGO=1.9 DB=mysql
26+
- DJANGO=1.10 DB=mysql
27+
- DJANGO=1.11 DB=mysql
4428

45-
- TOXENV=pypy-d18-pg
46-
- TOXENV=pypy-d18-sqlite
47-
- TOXENV=pypy-d19-pg
48-
- TOXENV=pypy-d19-sqlite
4929

50-
- TOXENV=pypy-d110-pg
51-
- TOXENV=pypy-d110-sqlite
30+
matrix:
31+
exclude:
32+
- python: 2.7
33+
env: DJANGO=2.0
5234

35+
- python: 3.4
36+
env: DJANGO=2.0
5337

38+
- python: 3.6
39+
env: DJANGO=1.8
40+
- python: 3.6
41+
env: DJANGO=1.9
42+
- python: 3.6
43+
env: DJANGO=1.10
5444

5545
install:
5646
- pip install tox "coverage<=4.0" python-coveralls>=2.5 coveralls>=0.5 codecov
5747

5848
script:
59-
- tox -e $TOXENV -- py.test tests -v --capture=no --cov=concurrency --cov-report=xml --cov-config=tests/.coveragerc
49+
- tox -e "py${TRAVIS_PYTHON_VERSION//.}-d${DJANGO//.}-${DB}" -- py.test tests -v
6050

6151
before_success:
6252
- coverage erase
6353

6454
after_success:
6555
- coverage combine
66-
- coveralls
6756
- codecov
6857

6958

CHANGES

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
Release 1.4 (dev)
2-
-----------------
1+
Release 1.4
2+
-----------
3+
* closes :issue:`81`. Add docs and check.
4+
* fixes :issue:`80`. (thanks Naddiseo for the useful support)
35
* Django 1.11 compatibility
46
* some minor support for Django 2.0
57

8+
69
Release 1.3.2 (10 Sep 2016)
7-
-------------------------
10+
---------------------------
811
* fixes bug in ConditionalVersionField that produced 'maximum recursion error' when a model had a ManyToManyField with a field to same model (self-relation)
912

1013

1114
Release 1.3.1 (15 Jul 2016)
12-
-------------------------
15+
---------------------------
1316
* just packaging
1417

1518

@@ -117,7 +120,7 @@ Release 0.5.0
117120

118121

119122
Release 0.4.0
120-
---------------------------------
123+
-------------
121124
* start deprecation of ``concurrency.core.VersionChangedError``, ``concurrency.core.RecordModifiedError``,
122125
``concurrency.core.InconsistencyError``,moved in ``concurrency.exceptions``
123126
* start deprecation of ``concurrency.core.apply_concurrency_check``, ``concurrency.core.concurrency_check`` moved in ``concurrency.api``
@@ -127,13 +130,13 @@ Release 0.4.0
127130
* changed way to add concurrency to existing models (:ref:`apply_concurrency_check`)
128131
* fixed :issue:`4` (thanks FrankBie)
129132
* removed RandomVersionField
130-
* new :ref:`concurrency_check`
133+
* new `concurrency_check`
131134
* added :ref:`concurrentform` to mitigate some concurrency conflict
132135
* select_for_update now executed with ``nowait=True``
133136
* removed some internal methods, to avoid unlikely but possible name clashes
134137

135138

136139
Release 0.3.2
137-
---------------------------------
140+
-------------
138141
* fixed :issue:`3` (thanks pombredanne)
139142
* fixed :issue:`1` (thanks mbrochh)

README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ Links
6969
.. |master-build| image:: https://secure.travis-ci.org/saxix/django-concurrency.png?branch=master
7070
:target: http://travis-ci.org/saxix/django-concurrency/
7171

72-
.. |master-cov| image:: https://coveralls.io/repos/saxix/django-concurrency/badge.svg?branch=master&service=github
73-
:target: https://coveralls.io/github/saxix/django-concurrency?branch=master
74-
72+
.. |master-cov| image:: https://codecov.io/gh/saxix/django-concurrency/branch/master/graph/badge.svg
73+
:target: https://codecov.io/gh/saxix/django-concurrency
7574

7675
.. |dev-build| image:: https://secure.travis-ci.org/saxix/django-concurrency.png?branch=develop
7776
:target: http://travis-ci.org/saxix/django-concurrency/
7877

79-
.. |dev-cov| image:: https://coveralls.io/repos/saxix/django-concurrency/badge.svg?branch=develop&service=github
80-
:target: https://coveralls.io/github/saxix/django-concurrency?branch=develop
78+
.. |dev-cov| image:: https://codecov.io/gh/saxix/django-concurrency/branch/develop/graph/badge.svg
79+
:target: https://codecov.io/gh/saxix/django-concurrency
80+
8181

8282

8383
.. |wheel| image:: https://pypip.in/wheel/blackhole/badge.png

docs/admin.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.. include:: globals.txt
22
.. _admin:
33

4-
==================
4+
=================
55
Admin Integration
6-
==================
6+
=================
77

88
.. contents::
99
:local:

docs/api.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ ConcurrentModelAdmin
7575
--------------------
7676
.. autoclass:: concurrency.admin.ConcurrentModelAdmin
7777

78+
.. warning:: If you customize ``fields`` or ``fieldsets`` remember to add version field to the list. (See issue :ghissue:`81`)
79+
80+
81+
7882
.. _ConcurrencyActionMixin:
7983

8084
ConcurrencyActionMixin
@@ -115,7 +119,6 @@ concurrency.views.conflict
115119
Helpers
116120
-------
117121

118-
119122
.. _apply_concurrency_check:
120123

121124
`apply_concurrency_check()`
@@ -132,8 +135,7 @@ Add concurrency check to existing classes.
132135
you need to use a migration to add a `VersionField` to the desired Model.
133136

134137

135-
.. note:: See ``demo.auth_migrations`` for a example how to add
136-
:class:`IntegerVersionField <concurrency.fields.IntegerVersionField>` to :class:`auth.Group` )
138+
.. note:: See ``demo.auth_migrations`` for a example how to add :class:`IntegerVersionField <concurrency.fields.IntegerVersionField>` to :class:`auth.Group` )
137139

138140
.. code-block:: python
139141

docs/conf.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858

5959
}
6060

61+
github_project_url = 'https://github.com/saxix/django-concurrency'
62+
6163
todo_include_todos = True
6264

6365
# Add any paths that contain templates here, relative to this directory.
@@ -128,14 +130,7 @@
128130

129131
# The theme to use for HTML and HTML Help pages. See the documentation for
130132
# a list of builtin themes.
131-
132-
if os.environ.get('READTHEDOCS', None) == 'True':
133-
html_theme = "sphinx_rtd_theme"
134-
else:
135-
import sphinx_rtd_theme
136-
137-
html_theme = "sphinx_rtd_theme"
138-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
133+
html_theme = "default"
139134
#
140135
# Theme options are theme-specific and customize the look and feel of a theme
141136
# further. For a list of options available for each theme, see the

docs/faq.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,23 @@ FAQ
99
.. contents::
1010
:local:
1111

12-
.. _south:
12+
13+
14+
I use Django-Rest-Framework and |concurrency| seems do not work
15+
---------------------------------------------------------------
16+
Use :setting:`CONCURRENCY_IGNORE_DEFAULT` accordingly or be sure
17+
that serializer does not set `0` as initial value
18+
19+
20+
21+
Just added |concurrency| to existing project and it does not work
22+
-----------------------------------------------------------------
23+
24+
Check that your records do not have `0` as version number
25+
and use :setting:`CONCURRENCY_IGNORE_DEFAULT` accordingly
26+
27+
28+
.. _south_support:
1329

1430
South support ?
1531
---------------

docs/fields.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,11 @@ TriggerVersionField
3636
This field use a database trigger to update the version field.
3737
Using this you can control external updates (ie using tools like phpMyAdmin, pgAdmin, SQLDeveloper).
3838
The trigger is automatically created during ``syncdb()``
39-
or you can use the :ref:`triggers` management command.
39+
or you can use the `triggers`_ management command.
4040

4141
.. versionchanged:: 1.0
4242

43-
.. warning:: Before |concurrency| 1.0 two triggers per field were created,
44-
if you are upgrading you must manually remove old triggers and recreate them
45-
using :ref:`triggers`_ management command
43+
.. warning:: Before |concurrency| 1.0 two triggers per field were created, if you are upgrading you must manually remove old triggers and recreate them using `triggers`_ management command
4644

4745
`trigger_name`
4846
~~~~~~~~~~~~~~
@@ -67,8 +65,6 @@ Otherwise for each `TriggerVersionField` will be created two triggers named:
6765
`triggers` management command
6866
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6967

70-
.. command:: triggers
71-
7268
Helper command to work with triggers:
7369

7470
* ``list`` : list existing triggers for each database

docs/settings.rst

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
Settings
66
========
77

8-
Available settings
9-
==================
10-
118
Here's a full list of all available settings, in alphabetical order, and their
129
default values.
1310

@@ -69,6 +66,24 @@ while passing into the context the object that is going to be saved (``target``)
6966
.. seealso:: :ref:`middleware`
7067

7168

69+
70+
.. setting:: CONCURRENCY_IGNORE_DEFAULT
71+
72+
IGNORE_DEFAULT
73+
--------------
74+
.. versionadded:: 1.2
75+
76+
Default: ``True``
77+
78+
Determines whether a default version number is ignored or used in a concurrency check. While this
79+
configuration defaults to True for backwards compatibility, this setting can cause omitted version
80+
numbers to pass concurrency checks. New implementations are recommended to set this to ``False``.
81+
82+
.. note:: For security reasons, starting from version 1.5, default value will be ``False``.
83+
84+
85+
86+
7287
.. setting:: CONCURRECY_MANUAL_TRIGGERS
7388

7489
MANUAL_TRIGGERS
@@ -82,6 +97,7 @@ If false do not automatically create triggers, you can create them using :ref:`t
8297

8398

8499

100+
85101
.. setting:: CONCURRENCY_POLICY
86102

87103
POLICY
@@ -94,32 +110,18 @@ Default: ``CONCURRENCY_LIST_EDITABLE_POLICY_SILENT``
94110

95111
.. setting:: CONCURRENCY_IGNORE_DEFAULT
96112

97-
IGNORE_DEFAULT
98-
--------------
99-
.. versionadded:: >1.2
100-
101-
Default: ``True``
102-
103-
Determines whether a default version number is ignored or used in a concurrency check. While this
104-
configuration defaults to True for backwards compatibility, this setting can cause omitted version
105-
numbers to pass concurrency checks. New implementations are recommended to set this to ``False``.
106-
107-
.. note:: For security reasons, starting from version 1.5, default value will be ``False``.
108-
109113

110114
``CONCURRENCY_LIST_EDITABLE_POLICY_SILENT``
111115
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112116
Used by admin's integrations to handle ``list_editable`` conflicts.
113117
Do not save conflicting records, continue and save all non-conflicting records,
114118
show a message to the user
115119

120+
116121
``CONCURRENCY_LIST_EDITABLE_POLICY_ABORT_ALL``
117122
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
118123
Used by admin's integations to handle ``list_editable``.
119-
Stop at the first conflict and raise
120-
:class:`RecordModifiedError <concurrency.exceptions.RecordModifiedError>`.
121-
Note that if you want to use
122-
:class:`ConcurrencyMiddleware <concurrency.middleware.ConcurrencyMiddleware>`
123-
based conflict management you must set this flag.
124+
Stop at the first conflict and raise :class:`RecordModifiedError <concurrency.exceptions.RecordModifiedError>`.
125+
Note that if you want to use :class:`ConcurrencyMiddleware <concurrency.middleware.ConcurrencyMiddleware>` based conflict management you must set this flag.
124126

125127
.. seealso:: :ref:`list_editable`, :ref:`middleware`

0 commit comments

Comments
 (0)