Skip to content

Commit

Permalink
Merge branch 'release/1.4'
Browse files Browse the repository at this point in the history
* 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
  ...
  • Loading branch information
saxix committed Jul 9, 2017
2 parents ff45e55 + 38102cb commit 491b761
Show file tree
Hide file tree
Showing 51 changed files with 571 additions and 271 deletions.
61 changes: 25 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
language: python
sudo: false
python:
- 2.7
- 3.4
- 3.5
- 3.6


cache:
directories:
Expand All @@ -12,58 +16,43 @@ services:
- PostgreSQL

env:
- TOXENV=py27-d18-pg
- TOXENV=py27-d18-sqlite
- TOXENV=py27-d18-mysql
- TOXENV=py27-d19-pg
- TOXENV=py27-d19-sqlite
- TOXENV=py27-d19-mysql
- TOXENV=py27-d110-pg
- TOXENV=py27-d110-sqlite
- TOXENV=py27-d110-mysql
- TOXENV=py27-d111-pg
- TOXENV=py27-d111-sqlite
- TOXENV=py27-d111-mysql

- TOXENV=py33-d18-pg
- TOXENV=py33-d18-sqlite

- TOXENV=py34-d18-pg
- TOXENV=py34-d18-sqlite
- TOXENV=py34-d19-pg
- TOXENV=py34-d19-sqlite
- DJANGO=1.8 DB=pg
- DJANGO=1.9 DB=pg
- DJANGO=1.10 DB=pg
- DJANGO=1.11 DB=pg

- TOXENV=py35-d18-pg
- TOXENV=py35-d18-sqlite
- TOXENV=py35-d19-pg
- TOXENV=py35-d19-sqlite
- TOXENV=py35-d110-pg
- TOXENV=py35-d110-sqlite
- TOXENV=py35-d111-pg
- TOXENV=py35-d111-sqlite
- DJANGO=1.8 DB=mysql
- DJANGO=1.9 DB=mysql
- DJANGO=1.10 DB=mysql
- DJANGO=1.11 DB=mysql

- TOXENV=pypy-d18-pg
- TOXENV=pypy-d18-sqlite
- TOXENV=pypy-d19-pg
- TOXENV=pypy-d19-sqlite

- TOXENV=pypy-d110-pg
- TOXENV=pypy-d110-sqlite
matrix:
exclude:
- python: 2.7
env: DJANGO=2.0

- python: 3.4
env: DJANGO=2.0

- python: 3.6
env: DJANGO=1.8
- python: 3.6
env: DJANGO=1.9
- python: 3.6
env: DJANGO=1.10

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

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

before_success:
- coverage erase

after_success:
- coverage combine
- coveralls
- codecov


Expand Down
17 changes: 10 additions & 7 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
Release 1.4 (dev)
-----------------
Release 1.4
-----------
* closes :issue:`81`. Add docs and check.
* fixes :issue:`80`. (thanks Naddiseo for the useful support)
* Django 1.11 compatibility
* some minor support for Django 2.0


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


Release 1.3.1 (15 Jul 2016)
-------------------------
---------------------------
* just packaging


Expand Down Expand Up @@ -117,7 +120,7 @@ Release 0.5.0


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


Release 0.3.2
---------------------------------
-------------
* fixed :issue:`3` (thanks pombredanne)
* fixed :issue:`1` (thanks mbrochh)
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ Links
.. |master-build| image:: https://secure.travis-ci.org/saxix/django-concurrency.png?branch=master
:target: http://travis-ci.org/saxix/django-concurrency/

.. |master-cov| image:: https://coveralls.io/repos/saxix/django-concurrency/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/saxix/django-concurrency?branch=master

.. |master-cov| image:: https://codecov.io/gh/saxix/django-concurrency/branch/master/graph/badge.svg
:target: https://codecov.io/gh/saxix/django-concurrency

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

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



.. |wheel| image:: https://pypip.in/wheel/blackhole/badge.png
Expand Down
4 changes: 2 additions & 2 deletions docs/admin.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.. include:: globals.txt
.. _admin:

==================
=================
Admin Integration
==================
=================

.. contents::
:local:
Expand Down
8 changes: 5 additions & 3 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ ConcurrentModelAdmin
--------------------
.. autoclass:: concurrency.admin.ConcurrentModelAdmin

.. warning:: If you customize ``fields`` or ``fieldsets`` remember to add version field to the list. (See issue :ghissue:`81`)



.. _ConcurrencyActionMixin:

ConcurrencyActionMixin
Expand Down Expand Up @@ -115,7 +119,6 @@ concurrency.views.conflict
Helpers
-------


.. _apply_concurrency_check:

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


.. note:: See ``demo.auth_migrations`` for a example how to add
:class:`IntegerVersionField <concurrency.fields.IntegerVersionField>` to :class:`auth.Group` )
.. note:: See ``demo.auth_migrations`` for a example how to add :class:`IntegerVersionField <concurrency.fields.IntegerVersionField>` to :class:`auth.Group` )

.. code-block:: python
Expand Down
11 changes: 3 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@

}

github_project_url = 'https://github.com/saxix/django-concurrency'

todo_include_todos = True

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

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

if os.environ.get('READTHEDOCS', None) == 'True':
html_theme = "sphinx_rtd_theme"
else:
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme = "default"
#
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
18 changes: 17 additions & 1 deletion docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,23 @@ FAQ
.. contents::
:local:

.. _south:


I use Django-Rest-Framework and |concurrency| seems do not work
---------------------------------------------------------------
Use :setting:`CONCURRENCY_IGNORE_DEFAULT` accordingly or be sure
that serializer does not set `0` as initial value



Just added |concurrency| to existing project and it does not work
-----------------------------------------------------------------

Check that your records do not have `0` as version number
and use :setting:`CONCURRENCY_IGNORE_DEFAULT` accordingly


.. _south_support:

South support ?
---------------
Expand Down
8 changes: 2 additions & 6 deletions docs/fields.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ 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.
or you can use the `triggers`_ management command.

.. versionchanged:: 1.0

.. 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 :ref:`triggers`_ management command
.. 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

`trigger_name`
~~~~~~~~~~~~~~
Expand All @@ -67,8 +65,6 @@ Otherwise for each `TriggerVersionField` will be created two triggers named:
`triggers` management command
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. command:: triggers

Helper command to work with triggers:

* ``list`` : list existing triggers for each database
Expand Down
42 changes: 22 additions & 20 deletions docs/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
Settings
========

Available settings
==================

Here's a full list of all available settings, in alphabetical order, and their
default values.

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



.. setting:: CONCURRENCY_IGNORE_DEFAULT

IGNORE_DEFAULT
--------------
.. versionadded:: 1.2

Default: ``True``

Determines whether a default version number is ignored or used in a concurrency check. While this
configuration defaults to True for backwards compatibility, this setting can cause omitted version
numbers to pass concurrency checks. New implementations are recommended to set this to ``False``.

.. note:: For security reasons, starting from version 1.5, default value will be ``False``.




.. setting:: CONCURRECY_MANUAL_TRIGGERS

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




.. setting:: CONCURRENCY_POLICY

POLICY
Expand All @@ -94,32 +110,18 @@ Default: ``CONCURRENCY_LIST_EDITABLE_POLICY_SILENT``

.. setting:: CONCURRENCY_IGNORE_DEFAULT

IGNORE_DEFAULT
--------------
.. versionadded:: >1.2

Default: ``True``

Determines whether a default version number is ignored or used in a concurrency check. While this
configuration defaults to True for backwards compatibility, this setting can cause omitted version
numbers to pass concurrency checks. New implementations are recommended to set this to ``False``.

.. note:: For security reasons, starting from version 1.5, default value will be ``False``.


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


``CONCURRENCY_LIST_EDITABLE_POLICY_ABORT_ALL``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Used by admin's integations to handle ``list_editable``.
Stop at the first conflict and raise
:class:`RecordModifiedError <concurrency.exceptions.RecordModifiedError>`.
Note that if you want to use
:class:`ConcurrencyMiddleware <concurrency.middleware.ConcurrencyMiddleware>`
based conflict management you must set this flag.
Stop at the first conflict and raise :class:`RecordModifiedError <concurrency.exceptions.RecordModifiedError>`.
Note that if you want to use :class:`ConcurrencyMiddleware <concurrency.middleware.ConcurrencyMiddleware>` based conflict management you must set this flag.

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

0 comments on commit 491b761

Please sign in to comment.