Skip to content

Commit 227cbfe

Browse files
committed
Merge branch 'release/1.0rc1'
* release/1.0rc1: (43 commits) bump v1.0 Add Gitter badge fixes packaging updates documentation updates README 1.0rc1 meve pytest config to setup.cfg code clean bug fixes start creating a low leve API removes python 2.6 code removes commented code removes unused function argument rename TriggerGactory.list() -> get_list() rename inner function docs: remove badges more code clean more code clean code clean: removed old unused wrappers updates README ...
2 parents c2690c9 + f4c0fc1 commit 227cbfe

File tree

104 files changed

+1995
-1628
lines changed

Some content is hidden

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

104 files changed

+1995
-1628
lines changed

.editorconfig

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*.py]
6+
indent_style = space
7+
indent_size = 4
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
end_of_line = lf
11+
charset = utf-8
12+
13+
# Use 2 spaces for the HTML files
14+
[*.html]
15+
indent_size = 2
16+
17+
# The JSON files contain newlines inconsistently
18+
[*.json]
19+
indent_size = 2
20+
insert_final_newline = ignore
21+
22+
[**/admin/js/vendor/**]
23+
indent_style = ignore
24+
indent_size = ignore
25+
26+
# Minified JavaScript files shouldn't be changed
27+
[**.min.js]
28+
indent_style = ignore
29+
insert_final_newline = ignore
30+
31+
# Makefiles always use tabs for indentation
32+
[Makefile]
33+
indent_style = tab
34+
35+
# Batch files use tabs for indentation
36+
[*.bat]
37+
indent_style = tab

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
˜*
2+
.appveyor.yml
3+
.coverage
4+
coverage.xml
25
~build
36
.idea
47
.tox
5-
.*
8+
.DS_Store
9+
.cache
610
notes.txt
711
docs/build/
812
/dist
@@ -16,4 +20,3 @@ docs/build/
1620
*.pyc
1721
*.egg-info
1822
*.sqlite
19-
*/settings/active.py

.travis.yml

Lines changed: 34 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,51 @@
11
language: python
2-
python:
3-
- "2.7"
4-
- "3.4"
2+
sudo: false
53

64
cache:
7-
- pip
5+
directories:
6+
- $HOME/.cache/pip
87

9-
sudo: false
8+
branches:
9+
only:
10+
- develop
11+
- feature/travis
1012

1113
services:
1214
- MySQL
1315
- PostgreSQL
1416

1517
env:
16-
- DJANGO=1.4.x DBENGINE=pg
17-
- DJANGO=1.5.x DBENGINE=pg
18-
- DJANGO=1.6.x DBENGINE=pg
19-
- DJANGO=1.7.x DBENGINE=pg
20-
- DJANGO=1.8.x DBENGINE=pg
21-
- DJANGO=dev DBENGINE=pg
22-
23-
- DJANGO=1.4.x DBENGINE=mysql
24-
- DJANGO=1.5.x DBENGINE=mysql
25-
- DJANGO=1.6.x DBENGINE=mysql
26-
- DJANGO=1.7.x DBENGINE=mysql
27-
- DJANGO=1.8.x DBENGINE=mysql
28-
- DJANGO=dev DBENGINE=pg
18+
# Travis give a TemplateDoesNotExist exception with django==1.6.x
19+
# - TOXENV=py27-d16-pg
20+
# - TOXENV=py27-d16-sqlite
21+
# - TOXENV=py27-d16-mysql
22+
- TOXENV=py27-d17-pg
23+
- TOXENV=py27-d17-sqlite
24+
- TOXENV=py27-d17-mysql
25+
- TOXENV=py27-d18-pg
26+
- TOXENV=py27-d18-sqlite
27+
- TOXENV=py27-d18-mysql
28+
- TOXENV=py27-d19-pg
29+
- TOXENV=py27-d19-sqlite
30+
- TOXENV=py27-d19-mysql
31+
- TOXENV=py33-d17-pg
32+
- TOXENV=py33-d17-sqlite
33+
- TOXENV=py33-d18-pg
34+
- TOXENV=py33-d18-sqlite
35+
- TOXENV=py34-d17-pg
36+
- TOXENV=py34-d17-sqlite
37+
- TOXENV=py34-d18-pg
38+
- TOXENV=py34-d18-sqlite
39+
- TOXENV=py34-d19-pg
40+
- TOXENV=py34-d19-sqlite
41+
# - TOXENV=py35-d19-pg
42+
# - TOXENV=py35-d19-sqlite
2943

3044
install:
31-
- pip install tox>=1.8
32-
- pip install python-coveralls>=2.5 coveralls>=0.5
33-
45+
- pip install tox coverage coveralls>=0.5
3446

3547
script:
36-
- make coverage
48+
- tox -e $TOXENV --recreate -- -vv --capture=no --cov=concurrency --cov-report=xml --cov-config=tests/.coveragerc
3749

3850
before_success:
3951
- coverage erase
@@ -42,27 +54,3 @@ after_success:
4254
- coverage combine
4355
- coveralls
4456

45-
matrix:
46-
allow_failures:
47-
- env: DJANGO=dev DBENGINE=pg
48-
49-
exclude:
50-
- python: "3.4"
51-
env: DJANGO=1.4.x DBENGINE=pg
52-
- python: "3.4"
53-
env: DJANGO=1.5.x DBENGINE=pg
54-
- python: "3.4"
55-
env: DJANGO=1.6.x DBENGINE=pg
56-
57-
- python: "3.4"
58-
env: DJANGO=1.4.x DBENGINE=mysql
59-
- python: "3.4"
60-
env: DJANGO=1.5.x DBENGINE=mysql
61-
- python: "3.4"
62-
env: DJANGO=1.6.x DBENGINE=mysql
63-
- python: "3.4"
64-
env: DJANGO=1.7.x DBENGINE=mysql
65-
- python: "3.4"
66-
env: DJANGO=1.8.x DBENGINE=mysql
67-
- python: "3.4"
68-
env: DJANGO=dev DBENGINE=mysql

CHANGES

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
1+
Release 1.0
2+
-----------
3+
* **BACKWARD INCOMPATIBLE**:: dropped support for django prior 1.6
4+
* code clean
5+
* fixes :issue:`54` (thanks vmspike).
6+
* fixes :issue:`53`. updates Documentation
7+
* :ref:`disable_concurrency` can now disable concurrency in any model
8+
* :ref:`disable_concurrency` is now also a decorator
9+
* **BACKWARD INCOMPATIBLE**:: removed custom backends. ``TriggerVerionField`` can be used with standard Django
10+
* new way to create triggers (thanks Naddiseo)
11+
* new trigger code
12+
* new :method:`TriggerVersionField.check`.
13+
* new :attr:`TriggerVersionField.trigger_name`.
14+
* new :setting:`CONCURRECY_ENABLED` to fully disable concurrency
15+
* new :setting:`CONCURRECY_MANUAL_TRIGGERS` to disable triggers auto creation fixes :issue:`41` (thanks Naddiseo)
16+
117
Release 0.9
218
-----------
319
* django 1.8 compatibility
420
* python 3.4 compatibility
5-
* **BACKWARD INCOMPATIBLE** :ref:`disable_concurrency` works differently if used with classes or instances
21+
* **BACKWARD INCOMPATIBLE** :function:`disable_concurrency` works differently if used with classes or instances
622
* better support for external Models (models that are part of plugged-in applications)
723
* fixes issue with TriggerVersioField and Proxy Models (thanx Richard Eames)
824

@@ -41,7 +57,7 @@ Release 0.6.0
4157
* new :ref:`disable_concurrency` context manager
4258
* added documentation for :ref:`concurrency.middleware.ConcurrencyMiddleware <concurrencymiddleware>`
4359
* **BACKWARD INCOMPATIBLE** Fixed typo: ``CONCURRECY_SANITY_CHECK`` now ``CONCURRENCY_SANITY_CHECK``
44-
* added :ref:`disable_sanity_check` context manager
60+
* added ``disable_sanity_check`` context manager
4561
* added configuration
4662
* check admin actions for concurrent deletion
4763
* added concurrency check for admin's :ref:`list_editable`

MANIFEST.in

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ include CHANGES
44
include LICENSE
55
include MANIFEST.in
66
include setup.py
7-
recursive-include concurrency *.py
8-
recursive-include concurrency/templates *.html
9-
recursive-exclude docs *.py
10-
recursive-exclude tests *.*
7+
recursive-include src *
8+
recursive-exclude src/django_concurrency.egg-info *
9+
recursive-exclude src *.py[oc]

Makefile

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
VERSION=2.0.0
22
BUILDDIR='~build'
33
PYTHONPATH:=${PWD}/tests/:${PWD}
4-
DJANGO_14='django>=1.4,<1.5'
5-
DJANGO_15='django>=1.5,<1.6'
6-
DJANGO_16='django>=1.6,<1.7'
7-
DJANGO_17='django>=1.7,<1.8'
8-
DJANGO_18='django>=1.8,<1.9'
9-
DJANGO_DEV=git+git://github.com/django/django.git
10-
DBENGINE?=sqlite
4+
DBENGINE?=pg
115
DJANGO?='1.7.x'
126

137

@@ -19,12 +13,12 @@ install-deps:
1913
@pip install -qr requirements/tests.pip
2014
@sh -c "if [ '${DBENGINE}' = 'mysql' ]; then pip install MySQL-python; fi"
2115
@sh -c "if [ '${DBENGINE}' = 'pg' ]; then pip install -q psycopg2; fi"
22-
@sh -c "if [ '${DJANGO}' = '1.4.x' ]; then pip install ${DJANGO_14}; fi"
23-
@sh -c "if [ '${DJANGO}' = '1.5.x' ]; then pip install ${DJANGO_15}; fi"
24-
@sh -c "if [ '${DJANGO}' = '1.6.x' ]; then pip install ${DJANGO_16}; fi"
25-
@sh -c "if [ '${DJANGO}' = '1.7.x' ]; then pip install ${DJANGO_17}; fi"
26-
@sh -c "if [ '${DJANGO}' = '1.8.x' ]; then pip install ${DJANGO_18}; fi"
27-
@sh -c "if [ '${DJANGO}' = 'dev' ]; then pip install ${DJANGO_DEV}; fi"
16+
@sh -c "if [ '${DJANGO}' = '1.4.x' ]; then pip install 'django>=1.4,<1.5'; fi"
17+
@sh -c "if [ '${DJANGO}' = '1.5.x' ]; then pip install 'django>=1.5,<1.6'; fi"
18+
@sh -c "if [ '${DJANGO}' = '1.6.x' ]; then pip install 'django>=1.6,<1.7'; fi"
19+
@sh -c "if [ '${DJANGO}' = '1.7.x' ]; then pip install 'django>=1.7,<1.8'; fi"
20+
@sh -c "if [ '${DJANGO}' = '1.8.x' ]; then pip install 'django>=1.8,<1.9'; fi"
21+
@sh -c "if [ '${DJANGO}' = 'dev' ]; then pip install git+git://github.com/django/django.git; fi"
2822

2923

3024
init-db:
@@ -38,15 +32,21 @@ test:
3832
py.test -v
3933

4034

41-
coverage: mkbuilddir install-deps init-db
42-
echo ${PYTHONPATH};
35+
ci: mkbuilddir install-deps init-db
36+
$(MAKE) coverage
37+
38+
coverage:
4339
PYTHONPATH=${PWD}/tests/:${PWD} py.test tests -v --cov=concurrency --cov-report=html --cov-config=tests/.coveragerc -q
4440

4541

4642
clean:
4743
rm -fr ${BUILDDIR} dist *.egg-info .coverage
48-
find . -name __pycache__ -o -name "*.py?" -o -name "*.orig" -prune | xargs rm -rf
49-
find concurrency/locale -name django.mo | xargs rm -f
44+
find src -name __pycache__ -o -name "*.py?" -o -name "*.orig" -prune | xargs rm -rf
45+
find src/concurrency/locale -name django.mo | xargs rm -f
46+
47+
fullclean:
48+
rm -fr .tox .cache
49+
$(MAKE) clean
5050

5151

5252
docs: mkbuilddir

README.rst

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Django Concurrency
1212

1313
django-concurrency is an optimistic lock [1]_ implementation for Django.
1414

15-
Tested with: 1.4.x, 1.5.x, 1.6.x, 1.7.x 1.8.x.
15+
Supported Django versions: 1.7.x 1.8.x, 1.9rc1.
1616

1717
It prevents users from doing concurrent editing in Django both from UI and from a
1818
django command.
@@ -22,15 +22,21 @@ How it works
2222
------------
2323
sample code::
2424

25+
from django.db import models
2526
from concurrency.fields import IntegerVersionField
2627

2728
class ConcurrentModel( models.Model ):
2829
version = IntegerVersionField( )
30+
name = models.CharField(max_length=100)
2931

3032
Now if you try::
3133

3234
a = ConcurrentModel.objects.get(pk=1)
35+
a.name = '1'
36+
3337
b = ConcurrentModel.objects.get(pk=1)
38+
b.name = '2'
39+
3440
a.save()
3541
b.save()
3642

@@ -43,19 +49,18 @@ Similar projects
4349
Other projects that handle concurrent editing are `django-optimistic-lock`_ and `django-locking`_ anyway concurrency is "a batteries included" optimistic lock management system, here some features not available elsewhere:
4450

4551
* can be applied to any model; not only your code (ie. django.contrib.auth.Group)
46-
* works with django 1.4-1.8
4752
* handle `list-editable`_ ChangeList. (handle `#11313 <https://code.djangoproject.com/ticket/11313>`_)
4853
* manage concurrency conflicts in admin's actions
49-
* can intercept changes performend out of the django app (ie using pgAdmin, phpMyAdmin, Toads) (using `TriggerVersionField_`
50-
54+
* can intercept changes performend out of the django app (ie using pgAdmin, phpMyAdmin, Toads) (using `TriggerVersionField`_)
55+
* can be disabled if needed (see `disable_concurrency`_)
5156

5257
Links
5358
~~~~~
5459

5560
+--------------------+----------------+--------------+------------------------+
56-
| Stable | |master-build| | |master-cov| | |master-req| |
61+
| Stable | |master-build| | |master-cov| | |
5762
+--------------------+----------------+--------------+------------------------+
58-
| Development | |dev-build| | |dev-cov| | |dev-req| |
63+
| Development | |dev-build| | |dev-cov| | |
5964
+--------------------+----------------+--------------+------------------------+
6065
| Project home page: |https://github.com/saxix/django-concurrency |
6166
+--------------------+---------------+----------------------------------------+
@@ -69,7 +74,7 @@ Links
6974
.. |master-build| image:: https://secure.travis-ci.org/saxix/django-concurrency.png?branch=master
7075
:target: http://travis-ci.org/saxix/django-concurrency/
7176

72-
.. |master-cov| image:: https://coveralls.io/repos/saxix/django-concurrency/badge.png?branch=master
77+
.. |master-cov| image:: https://img.shields.io/coveralls/saxix/django-concurrency/master.svg
7378
:target: https://coveralls.io/r/saxix/django-concurrency
7479

7580
.. |master-req| image:: https://requires.io/github/saxix/django-concurrency/requirements.png?branch=master
@@ -80,7 +85,7 @@ Links
8085
.. |dev-build| image:: https://secure.travis-ci.org/saxix/django-concurrency.png?branch=develop
8186
:target: http://travis-ci.org/saxix/django-concurrency/
8287

83-
.. |dev-cov| image:: https://coveralls.io/repos/saxix/django-concurrency/badge.png?branch=develop
88+
.. |dev-cov| image:: https://img.shields.io/coveralls/saxix/django-concurrency/develop.svg
8489
:target: https://coveralls.io/r/saxix/django-concurrency
8590

8691
.. |dev-req| image:: https://requires.io/github/saxix/django-concurrency/requirements.png?branch=develop
@@ -99,5 +104,12 @@ _list-editable: https://django-concurrency.readthedocs.org/en/latest/admin.html#
99104

100105
.. _TriggerVersionField: https://django-concurrency.readthedocs.org/en/latest/fields.html#triggerversionfield
101106

107+
.. _disable_concurrency: https://django-concurrency.readthedocs.org/en/latest/api.html?#disable-concurrency
108+
102109
.. [1] http://en.wikipedia.org/wiki/Optimistic_concurrency_control
103110
111+
112+
113+
.. image:: https://badges.gitter.im/Join%20Chat.svg
114+
:alt: Join the chat at https://gitter.im/saxix/django-concurrency
115+
:target: https://gitter.im/saxix/django-concurrency?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge

0 commit comments

Comments
 (0)