[Python-modules-commits] [django-reversion] 01/07: Import django-reversion_1.10.0.orig.tar.gz

Michael Fladischer fladi at moszumanska.debian.org
Fri Dec 4 16:41:34 UTC 2015


This is an automated email from the git hooks/post-receive script.

fladi pushed a commit to branch master
in repository django-reversion.

commit eff368a2f2f7ea64de7a9a772c7645afc7240b70
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date:   Fri Dec 4 17:06:51 2015 +0100

    Import django-reversion_1.10.0.orig.tar.gz
---
 .travis.yml                                        |  31 +-
 CHANGELOG.rst => CHANGELOG.md                      | 179 +++++++----
 MANIFEST.in                                        |   4 +-
 README.rst                                         |   8 +-
 docs/admin.rst                                     |  12 +-
 docs/api.rst                                       |  94 +++---
 docs/conf.py                                       |   4 +-
 docs/diffs.rst                                     |   8 +-
 docs/django-versions.rst                           |   2 +-
 docs/how-it-works.rst                              |   8 +-
 docs/index.rst                                     |   8 +-
 docs/signals.rst                                   |   9 +-
 setup.py                                           |   4 +-
 src/reversion/__init__.py                          |  43 +--
 src/reversion/admin.py                             |  16 +-
 src/reversion/errors.py                            |  13 +
 src/reversion/locale/de/LC_MESSAGES/django.mo      | Bin 2534 -> 2599 bytes
 src/reversion/locale/de/LC_MESSAGES/django.po      |   4 +
 src/reversion/locale/es_AR/LC_MESSAGES/django.mo   | Bin 0 -> 2507 bytes
 src/reversion/locale/es_AR/LC_MESSAGES/django.po   | 134 ++++++++
 .../management/commands/createinitialrevisions.py  |  12 +-
 src/reversion/models.py                            |  13 +-
 src/reversion/revisions.py                         |  46 ++-
 src/reversion/signals.py                           |   6 +
 src/reversion/version.py                           |   1 -
 src/tests/test_reversion/admin.py                  |   8 +-
 src/tests/test_reversion/tests.py                  | 354 +++++++++++----------
 27 files changed, 625 insertions(+), 396 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index e7b7b81..a53859a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,38 +2,43 @@ language: python
 sudo: false
 python:
   - 2.7
-  - 3.2
-  - 3.3
   - 3.4
+  - 3.5
 cache:
   directories:
     - $HOME/.cache/pip
 env:
-  - DJANGO=django==1.7.9
-  - DJANGO=django==1.7.9 DB_ENGINE="django.db.backends.postgresql_psycopg2" DB_NAME="test_project" DB_USER="postgres"
-  - DJANGO=django==1.7.9 DB_ENGINE="django.db.backends.mysql" DB_NAME="test_project" DB_USER="travis"
-  - DJANGO=django==1.8.3
-  - DJANGO=django==1.8.3 DB_ENGINE="django.db.backends.postgresql_psycopg2" DB_NAME="test_project" DB_USER="postgres"
-  - DJANGO=django==1.8.3 DB_ENGINE="django.db.backends.mysql" DB_NAME="test_project" DB_USER="travis"
+  - DJANGO=django==1.7.11
+  - DJANGO=django==1.7.11 DB_ENGINE="django.db.backends.postgresql_psycopg2" DB_NAME="test_project" DB_USER="postgres"
+  - DJANGO=django==1.7.11 DB_ENGINE="django.db.backends.mysql" DB_NAME="test_project" DB_USER="travis"
+  - DJANGO=django==1.8.7
+  - DJANGO=django==1.8.7 DB_ENGINE="django.db.backends.postgresql_psycopg2" DB_NAME="test_project" DB_USER="postgres"
+  - DJANGO=django==1.8.7 DB_ENGINE="django.db.backends.mysql" DB_NAME="test_project" DB_USER="travis"
+  - DJANGO=django==1.9.0
+  - DJANGO=django==1.9.0 DB_ENGINE="django.db.backends.postgresql" DB_NAME="test_project" DB_USER="postgres"
+  - DJANGO=django==1.9.0 DB_ENGINE="django.db.backends.mysql" DB_NAME="test_project" DB_USER="travis"
 matrix:
   fast_finish: true
   exclude:
-    # mysqlclient does not work with Python 3.2.
-    - python: 3.2
-      env: DJANGO=django==1.7.9 DB_ENGINE="django.db.backends.mysql" DB_NAME="test_project" DB_USER="travis"
-    - python: 3.2
-      env: DJANGO=django==1.8.3 DB_ENGINE="django.db.backends.mysql" DB_NAME="test_project" DB_USER="travis"
+    - python: 3.5
+      env: DJANGO=django==1.7.11
+    - python: 3.5
+      env: DJANGO=django==1.7.11 DB_ENGINE="django.db.backends.postgresql_psycopg2" DB_NAME="test_project" DB_USER="postgres"
+    - python: 3.5
+      env: DJANGO=django==1.7.11 DB_ENGINE="django.db.backends.mysql" DB_NAME="test_project" DB_USER="travis"
 services:
   - postgresql
   - mysql
 install:
   - travis_retry pip install $DJANGO
+  - if [[ "$DB_ENGINE" == "django.db.backends.postgresql" ]] ; then travis_retry pip install psycopg2; fi
   - if [[ "$DB_ENGINE" == "django.db.backends.postgresql_psycopg2" ]] ; then travis_retry pip install psycopg2; fi
   - if [[ "$DB_ENGINE" == "django.db.backends.mysql" ]] ; then travis_retry pip install mysqlclient ; fi
   - pip install -e .[test,diff]
 before_script:
   - if [[ "$DB_ENGINE" == "django.db.backends.mysql" ]] ; then mysql -e 'create database test_project'; fi
   - if [[ "$DB_ENGINE" == "django.db.backends.postgresql_psycopg2" ]] ; then psql -c 'create database test_project;' -U postgres; fi
+  - if [[ "$DB_ENGINE" == "django.db.backends.postgresql" ]] ; then psql -c 'create database test_project;' -U postgres; fi
 script: coverage run src/tests/manage.py test src/tests/test_reversion/
 after_script: coverage report
 notifications:
diff --git a/CHANGELOG.rst b/CHANGELOG.md
similarity index 67%
rename from CHANGELOG.rst
rename to CHANGELOG.md
index c45a5ef..f238213 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.md
@@ -1,28 +1,103 @@
-django-reversion changelog
-==========================
+# django-reversion changelog
 
 
-1.9.3 - 07/08/2015
-------------------
+## 1.10 - 02/12/2015
+
+- **Breaking:** Updated the location of [admin classes](http://django-reversion.readthedocs.org/en/latest/admin.html).
+
+    Prior to this change, you could access the `VersionAdmin` class using the following import:
+
+    ```py
+    # Old-style import for accessing the admin class.
+    import reversion
+
+    # Access admin class from the reversion namespace.
+    class YourModelAdmin(reversion.VersionAdmin):
+        ...
+    ```
+
+    In order to support Django 1.9, the admin class has been moved to the following
+    import:
+
+    ```py
+    # New-style import for accesssing admin class.
+    from reversion.admin import VersionAdmin
+
+    # Use the admin class directly.
+    class YourModelAdmin(VersionAdmin):
+        ...
+    ```
+
+- **Breaking:** Updated the location of [low-level API](http://django-reversion.readthedocs.org/en/latest/api.html) methods.
+    Prior to this change, you could access the low-level API using the following import:
+
+    ```py
+    # Old-style import for accessing the low-level API.
+    import reversion
+
+    # Use low-level API methods from the reversion namespace.
+    @reversion.register
+    class YourModel(models.Model):
+        ...
+    ```
+
+    In order to support Django 1.9, the low-level API
+    methods have been moved to the following import:
+
+    ```py
+    # New-style import for accesssing the low-level API.
+    from reversion import revisions
+
+    # Use low-level API methods from the revisions namespace.
+    @revisions.register
+    class YourModel(models.Model):
+        ...
+    ```
+
+- **Breaking:** Updated the location of [reversion signals](http://django-reversion.readthedocs.org/en/latest/signals.html).
+    Prior to this change, you could access the reversion signals using the following import:
+
+    ```py
+    # Old-style import for accessing the reversion signals
+    import reversion
+
+    # Use signals from the reversion namespace.
+    reversion.post_revision_commit.connect(...)
+    ```
+
+    In order to support Django 1.9, the reversion signals have been moved to the following
+    import:
+
+    ```py
+    # New-style import for accesssing the reversion signals.
+    from reversion.signals import pre_revision_commit, post_revision_commit
+
+    # Use reversion signals directly.
+    post_revision_commit.connect(...)
+    ```
+
+- Django 1.9 compatibility (@etianen).
+- Added spanish (argentina) translation (@gonzalobustos).
+- Minor bugfixes and tweaks (@Blitzstok, @IanLee1521, @lutoma, @siamalekpour, @etianen).
+
+
+## 1.9.3 - 07/08/2015
 
 - Fixing regression with admin redirects following save action (@etianen).
 
 
-1.9.2 - 07/08/2015
-------------------
+## 1.9.2 - 07/08/2015
 
 - Fixing regression with "delete", "save as new" and "save and continue" button being shown in recover and revision admin views (@etianen).
 - Fixing regression where VersionAdmin.ignore_duplicate_revisions was ignored (@etianen).
 
 
-1.9.1 - 04/08/2015
-------------------
+## 1.9.1 - 04/08/2015
 
 - Fixing packaging error that rendered the 1.9.0 release unusable. No way to cover up the mistake, so here's a brand new bugfix release! (@etianen).
 
 
-1.9.0 - 04/08/2015
-------------------
+## 1.9.0 - 04/08/2015
 
 - Using database transactions do render consistent views of past revisions in database admin, fixing a lot of lingering minor issues (@etianen).
 - Correct handling of readonly fields in admin (@etianen).
@@ -34,8 +109,7 @@ django-reversion changelog
 
 
 
-1.8.7 - 21/05/2015
-------------------
+## 1.8.7 - 21/05/2015
 
 - Fixing deleterevisions command on Python 3 (@davidfsmith).
 - Fixing Django 1.6 compatibility (@etianen).
@@ -43,30 +117,26 @@ django-reversion changelog
 - Minor tweaks (@nikolas, @etianen).
 
 
-1.8.6 - 13/04/2015
-------------------
+## 1.8.6 - 13/04/2015
 
 - Support for MySQL utf8mb4 (@alexhayes).
 - Fixing some Django deprecation warnings (Drew Hubl, @khakulov, @adonm).
 - Versions passed through by reversion.post_revision_commit now contain a primary key (@joelarson).
 
 
-1.8.5 - 31/10/2014
-------------------
+## 1.8.5 - 31/10/2014
 
 - Added support for proxy models (@AgDude, @bourivouh).
 - Allowing registration of models with django-reversion using custom signals (@ErwinJunge).
 - Fixing some Django deprecation warnings (@skipp, @narrowfail).
 
 
-1.8.4 - 07/09/2014
-------------------
+## 1.8.4 - 07/09/2014
 
 - Fixing including legacy south migrations in PyPi package (@GeyseR).
 
 
-1.8.3 - 06/09/2014
-------------------
+## 1.8.3 - 06/09/2014
 
 - Provisional Django 1.7 support (@etianen).
 - Multi-db and multi-manager support to management commands (@marekmalek).
@@ -74,8 +144,7 @@ django-reversion changelog
 - Minor bugfixes and documentation improvements (@coagulant).
 
 
-1.8.2 - 01/08/2014
-------------------
+## 1.8.2 - 01/08/2014
 
 - reversion.register() can now be used as a class decorator (@aquavitae).
 - Danish translation (@Vandborg).
@@ -84,8 +153,7 @@ django-reversion changelog
 - Minor bugfixes and documentation improvements (@marekmalek, @dhoffman34, @mauricioabreu, @mark0978).
 
 
-1.8.1 - 29/05/2014
-------------------
+## 1.8.1 - 29/05/2014
 
 - Slovak translation (@jbub).
 - Deleting a user no longer deletes the associated revisions (@daaray).
@@ -99,8 +167,7 @@ django-reversion changelog
 - Removed deprecated low-level API methods.
 
 
-1.8.0 - 01/11/2013
-------------------
+## 1.8.0 - 01/11/2013
 
 - Django 1.6 compatibility (@niwibe & @meshy).
 - Removing type flag from Version model.
@@ -110,84 +177,72 @@ django-reversion changelog
 - Fixing edge-case bugs in revision middleware (@pricem & @oppianmatt).
 
 
-1.7.1 - 26/06/2013
-------------------
+## 1.7.1 - 26/06/2013
 
 -  Bugfixes when using a custom User model.
 -  Minor bugfixes.
 
 
-1.7 - 27/02/2013
-----------------
+## 1.7 - 27/02/2013
 
 -  Django 1.5 compatibility.
 -  Experimantal Python 3.3 compatibility!
 
 
-1.6.6 - 12/02/2013
-------------------
+## 1.6.6 - 12/02/2013
 
 -  Removing version checking code. It's more trouble than it's worth.
 -  Dutch translation improvements.
 
 
-1.6.5 - 12/12/2012
-------------------
+## 1.6.5 - 12/12/2012
 
 -  Support for Django 1.4.3.
 
 
-1.6.4 - 28/10/2012
-------------------
+## 1.6.4 - 28/10/2012
 
 -  Support for Django 1.4.2.
 
 
-1.6.3 - 05/09/2012
-------------------
+## 1.6.3 - 05/09/2012
 
 -  Fixing issue with reverting models with unique constraints in the admin.
 -  Enforcing permissions in admin views.
 
 
-1.6.2 - 31/07/2012
-------------------
+## 1.6.2 - 31/07/2012
 
 -  Batch saving option in createinitialrevisions.
 -  Suppressing warning for Django 1.4.1.
 
 
-1.6.1 - 20/06/2012
-------------------
+## 1.6.1 - 20/06/2012
 
 -  Swedish translation.
 -  Fixing formating for PyPi readme and license.
 -  Minor features and bugfixes.
 
 
-1.6 - 27/03/2012
-----------------
+## 1.6 - 27/03/2012
 
 -  Django 1.4 compatibility.
 
 
-1.5.2 - 27/03/2012
-------------------
+## 1.5.2 - 27/03/2012
 
 -  Multi-db support.
 -  Brazillian Portuguese translation.
 -  New manage_manually revision mode.
 
 
-1.5.1 - 20/10/2011
-------------------
+## 1.5.1 - 20/10/2011
 
 -  Polish translation.
 -  Minor bug fixes.
 
 
-1.5 - 04/09/2011
-----------------
+## 1.5 - 04/09/2011
 
 -  Added in simplified low level API methods, and deprecated old low level API methods.
 -  Added in support for multiple revision managers running in the same project.
@@ -196,8 +251,7 @@ django-reversion changelog
 -  Minor bug fixes.
 
 
-1.4 - 27/04/2011
-----------------
+## 1.4 - 27/04/2011
 
 -  Added in a version flag for add / change / delete annotations.
 -  Added experimental deleterevisions management command.
@@ -205,8 +259,7 @@ django-reversion changelog
 -  Django 1.3 compatibility.
 
 
-1.3.3 - 05/03/2011
-------------------
+## 1.3.3 - 05/03/2011
 
 -  Improved resilience of revert() to database integrity errors.
 -  Added in Czech translation.
@@ -219,8 +272,7 @@ django-reversion changelog
 -  Fixed an edge-case UnicodeError.
 
 
-1.3.2 - 22/10/2010
-------------------
+## 1.3.2 - 22/10/2010
 
 -  Added Polish translation.
 -  Added French translation.
@@ -232,16 +284,14 @@ django-reversion changelog
 -  Fixed DoesNotExistError with OneToOneFields and follow.
 
 
-1.3.1 - 31/05/2010
-------------------
+## 1.3.1 - 31/05/2010
 
 This release is compatible with Django 1.2.1.
 
 -  Django 1.2.1 admin compatibility.
 
 
-1.2.1 - 03/03/2010
-------------------
+## 1.2.1 - 03/03/2010
 
 This release is compatible with Django 1.1.1.
 
@@ -252,16 +302,14 @@ This release is compatible with Django 1.1.1.
 -  Added Hebrew translation.
 
 
-1.2 - 12/10/2009
-----------------
+## 1.2 - 12/10/2009
 
 This release is compatible with Django 1.1.
 
 -  Django 1.1 admin compatibility.
 
 
-1.1.2 - 23/07/2009
-------------------
+## 1.1.2 - 23/07/2009
 
 This release is compatible with Django 1.0.4.
 
@@ -274,8 +322,7 @@ This release is compatible with Django 1.0.4.
 -  admin interface.
 
 
-1.1.1 - 25/03/2010
-------------------
+## 1.1.1 - 25/03/2010
 
 This release is compatible with Django 1.0.2.
 
diff --git a/MANIFEST.in b/MANIFEST.in
index 7e1ea62..258e5e9 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -2,7 +2,7 @@ include src/reversion/templates/reversion/*.html
 include src/reversion/locale/*/LC_MESSAGES/django.*
 include LICENSE
 include README.rst
-include CHANGELOG.rst
+include CHANGELOG.md
 include MANIFEST.in
 recursive-include docs *
-prune docs/_build
\ No newline at end of file
+prune docs/_build
diff --git a/README.rst b/README.rst
index c16b8ca..ddd41ec 100644
--- a/README.rst
+++ b/README.rst
@@ -25,7 +25,7 @@ Documentation
 
 Please read the `Getting Started <http://django-reversion.readthedocs.org/en/latest/>`_
 guide for more information.
-    
+
 Download instructions, bug reporting and links to full documentation can be
 found at the `main project website <http://github.com/etianen/django-reversion>`_.
 
@@ -42,7 +42,7 @@ documentation for information on any database changes and how to upgrade. If you
 South to manage database migrations in your project, then upgrading is as easy as running
 a few django management commands.
 
-It's always worth checking the `CHANGELOG <https://github.com/etianen/django-reversion/blob/master/CHANGELOG.rst>`_
+It's always worth checking the `CHANGELOG <https://github.com/etianen/django-reversion/blob/master/CHANGELOG.md>`_
 before upgrading too, just in case you get caught off-guard by a minor upgrade to the library.
 
 
@@ -66,13 +66,13 @@ The django-reversion project is built on every push with `Travis CI <https://tra
 .. image:: https://travis-ci.org/etianen/django-reversion.svg?branch=master
     :target: https://travis-ci.org/etianen/django-reversion
 
-    
+
 More information
 ----------------
 
 The django-reversion project was developed by Dave Hall. You can get the code
 from the `django-reversion project site <http://github.com/etianen/django-reversion>`_.
-    
+
 Dave Hall is a freelance web developer, based in Cambridge, UK. You can usually
 find him on the Internet in a number of different places:
 
diff --git a/docs/admin.rst b/docs/admin.rst
index 879b2d2..24cfb44 100644
--- a/docs/admin.rst
+++ b/docs/admin.rst
@@ -7,19 +7,19 @@ django-reversion can be used to add a powerful rollback and recovery facility to
 
 ::
 
-    import reversion
+    from reversion.admin import VersionAdmin
 
-    class YourModelAdmin(reversion.VersionAdmin):
+    class YourModelAdmin(VersionAdmin):
 
         pass
 
     admin.site.register(YourModel, YourModelAdmin)
 
-You can also use ``reversion.VersionAdmin`` as a mixin with another specialized admin class.
+You can also use ``VersionAdmin`` as a mixin with another specialized admin class.
 
 ::
 
-    class YourModelAdmin(reversion.VersionAdmin, YourBaseModelAdmin):
+    class YourModelAdmin(VersionAdmin, YourBaseModelAdmin):
 
         pass
 
@@ -35,11 +35,11 @@ If you're using an existing third party app, then you can add patch django-rever
 Admin customizations
 --------------------
 
-It's possible to customize the way django-reversion integrates with your admin site by specifying options on the subclass of ``reversion.VersionAdmin`` as follows:
+It's possible to customize the way django-reversion integrates with your admin site by specifying options on the subclass of ``VersionAdmin`` as follows:
 
 ::
 
-    class YourModelAdmin(reversion.VersionAdmin):
+    class YourModelAdmin(VersionAdmin):
 
         option_name = option_value
 
diff --git a/docs/api.rst b/docs/api.rst
index 4440a9f..54c3bd0 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -6,34 +6,46 @@ Low-level API
 You can use django-reversion's API to build powerful version-controlled views outside of the built-in admin site.
 
 
+Importing the low-level API
+---------------------------
+
+Import the low-level API as follows:
+
+::
+
+    from reversion import revisions
+
+**Note:** If using django-reversion < 1.10, import the low-level API using ``import reversion as revisions``.
+
+
 Registering models with django-reversion
 ----------------------------------------
 
-If you're already using the :ref:`admin integration <admin>` for a model, then there's no need to register it. However, if you want to register a model without using the admin integration, then you need to use the ``reversion.register()`` method.
+If you're already using the :ref:`admin integration <admin>` for a model, then there's no need to register it. However, if you want to register a model without using the admin integration, then you need to use the ``revisions.register()`` method.
 
 ::
 
-    import reversion
+    from reversion import revisions
 
-    reversion.register(YourModel)
+    revisions.register(YourModel)
 
-``reversion.register`` can also be used as a class decorator, with or without arguments.
+``revisions.register`` can also be used as a class decorator, with or without arguments.
 
 ::
 
-    import reversion
+    from reversion import revisions
 
-    @reversion.register
+    @revisions.register
     class YourModel(models.Model):
         ...
 
-    @reversion.register(format='yaml')
+    @revisions.register(format='yaml')
     class YourOtherModel(models.Model):
         ...
 
 **Warning:** If you’re using django-reversion in a management command, and are using the automatic ``VersionAdmin`` registration method, then you’ll need to import the relevant ``admin.py`` file at the top of your management command file.
 
-**Warning:** When Django starts up, some python scripts get loaded twice, which can cause 'already registered' errors to be thrown. If you place your calls to ``reversion.register()`` in the ``models.py`` file, immediately after the model definition, this problem will go away.
+**Warning:** When Django starts up, some python scripts get loaded twice, which can cause 'already registered' errors to be thrown. If you place your calls to ``revisions.register()`` in the ``models.py`` file, immediately after the model definition, this problem will go away.
 
 
 Creating revisions
@@ -46,27 +58,27 @@ A revision represents one or more changes made to your models, grouped together
 There are several ways to create revisions, as explained below. Although there is nothing stopping you from mixing and matching these approaches, it is recommended that you pick one of the methods and stick with it throughout your project.
 
 
-reversion.create_revision() decorator
+revisions.create_revision() decorator
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-You can decorate any function with the ``reversion.create_revision()`` decorator. Any changes to your models that occur during this function will be grouped together into a revision.
+You can decorate any function with the ``revisions.create_revision()`` decorator. Any changes to your models that occur during this function will be grouped together into a revision.
 
 ::
 
     @transaction.atomic()
-    @reversion.create_revision()
+    @revisions.create_revision()
     def you_view_func(request):
         your_model.save()
 
 
-reversion.create_revision() context manager
+revisions.create_revision() context manager
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 You can use a context manager to mark up a block of code. Once the block terminates, any changes made to your models will be grouped together into a revision.
 
 ::
 
-    with transaction.atomic(), reversion.create_revision():
+    with transaction.atomic(), revisions.create_revision():
         your_model.save()
 
 
@@ -82,7 +94,7 @@ To enable the revision middleware, simply add it to your ``MIDDLEWARE_CLASSES``
         # Other middleware goes here...
     )
 
-**Warning**: Due to changes in the Django 1.6 transaction handling, revision data will be saved in a separate database transaction to the one used to save your models, even if you set ``ATOMIC_REQUESTS = True``. If you need to ensure that your models and revisions are saved in the save transaction, please use the ``reversion.create_revision()`` context manager or decorator in combination with ``transaction.atomic()``.
+**Warning**: Due to changes in the Django 1.6 transaction handling, revision data will be saved in a separate database transaction to the one used to save your models, even if you set ``ATOMIC_REQUESTS = True``. If you need to ensure that your models and revisions are saved in the save transaction, please use the ``revisions.create_revision()`` context manager or decorator in combination with ``transaction.atomic()``.
 
 
 Version meta data
@@ -90,10 +102,10 @@ Version meta data
 
 It is possible to attach a comment and a user reference to an active revision using the following method::
 
-    with transaction.atomic(), reversion.create_revision():
+    with transaction.atomic(), revisions.create_revision():
         your_model.save()
-        reversion.set_user(user)
-        reversion.set_comment("Comment text...")
+        revisions.set_user(user)
+        revisions.set_comment("Comment text...")
 
 If you use ``RevisionMiddleware``, then the user will automatically be added to the revision from the incoming request.
 
@@ -111,7 +123,7 @@ You can attach custom meta data to a revision by creating a separate django mode
 
 You can then attach this meta class to a revision using the following method::
 
-    reversion.add_meta(VersionRating, rating=5)
+    revisions.add_meta(VersionRating, rating=5)
 
 
 Reverting to previous revisions
@@ -122,13 +134,13 @@ To revert a model to a previous version, use the following method::
     your_model = YourModel.objects.get(pk=1)
 
     # Build a list of all previous versions, latest versions first:
-    version_list = reversion.get_for_object(your_model)
+    version_list = revisions.get_for_object(your_model)
 
     # Build a list of all previous versions, latest versions first, duplicates removed:
-    version_list = reversion.get_for_object(your_model).get_unique()
+    version_list = revisions.get_for_object(your_model).get_unique()
 
     # Find the most recent version for a given date:
-    version = reversion.get_for_date(your_model, datetime.datetime(2008, 7, 10))
+    version = revisions.get_for_date(your_model, datetime.datetime(2008, 7, 10))
 
     # Access the model data stored within the version:
     version_data = version.field_dict
@@ -149,7 +161,7 @@ Recovering Deleted Objects
 To recover a deleted object, use the following method::
 
     # Built a list of all deleted objects, latest deletions first.
-    deleted_list = reversion.get_deleted(YourModel)
+    deleted_list = revisions.get_deleted(YourModel)
 
     # Access a specific deleted object.
     delete_version = deleted_list.get(id=5)
@@ -167,11 +179,11 @@ Advanced model registration
 Following foreign key relationships
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-Normally, when you save a model it will only save the primary key of any ForeignKey or ManyToMany fields. If you also wish to include the data of the foreign key in your revisions, pass a list of relationship names to the ``reversion.register()`` method.
+Normally, when you save a model it will only save the primary key of any ForeignKey or ManyToMany fields. If you also wish to include the data of the foreign key in your revisions, pass a list of relationship names to the ``revisions.register()`` method.
 
 ::
 
-    reversion.register(YourModel, follow=["your_foreign_key_field"])
+    revisions.register(YourModel, follow=["your_foreign_key_field"])
 
 **Please note:** If you use the follow parameter, you must also ensure that the related model has been registered with django-reversion.
 
@@ -183,8 +195,8 @@ In addition to ForeignKey and ManyToMany relationships, you can also specify rel
     class Pet(models.Model):
         person = models.ForeignKey(Person)
 
-    reversion.register(Person, follow=["pet_set"])
-    reversion.register(Pet)
+    revisions.register(Person, follow=["pet_set"])
+    revisions.register(Pet)
 
 Now whenever you save a revision containing a ``Person``, all related ``Pet`` instances will be automatically saved to the same revision.
 
@@ -201,19 +213,19 @@ For example::
     class Restaurant(Place):
         pass
 
-    reversion.register(Place)
-    reversion.register(Restaurant, follow=["place_ptr"])
+    revisions.register(Place)
+    revisions.register(Restaurant, follow=["place_ptr"])
 
 
 Saving a subset of fields
 ^^^^^^^^^^^^^^^^^^^^^^^^^
 
-If you only want a subset of fields to be saved to a revision, you can specify a ``fields`` or ``exclude`` argument to the ``reversion.register()`` method.
+If you only want a subset of fields to be saved to a revision, you can specify a ``fields`` or ``exclude`` argument to the ``revisions.register()`` method.
 
 ::
 
-    reversion.register(YourModel, fields=["pk", "foo", "bar"])
-    reversion.register(YourModel, exclude=["foo"])
+    revisions.register(YourModel, fields=["pk", "foo", "bar"])
+    revisions.register(YourModel, exclude=["foo"])
 
 **Please note:** If you are not careful, then it is possible to specify a combination of fields that will make the model impossible to recover. As such, approach this option with caution.
 
@@ -225,7 +237,7 @@ By default, django-reversion will serialize model data using the ``'json'`` seri
 
 ::
 
-    reversion.register(YourModel, format="yaml")
+    revisions.register(YourModel, format="yaml")
 
 **Please note:** The named serializer must serialize model data to a utf-8 encoded character string. Please verify that your serializer is compatible before using it with django-reversion.
 
@@ -240,15 +252,15 @@ By default, django-reversion saves a new revision whenever a model is saved, usi
     from django.db.models.signals import post_save
     from your_app.signals import custom_signal
 
-    reversion.register(YourModel, signals=[post_save, custom_signal])
+    revisions.register(YourModel, signals=[post_save, custom_signal])
 
-By default, revision data is serialized at the end of the ``reversion.create_revision()`` block, allowing foreign key references to be updated in the same block before the revision data is prepared. However, in some cases you might want to serialize the revision data immediately, such as times when the model is shortly going to be deleted.
+By default, revision data is serialized at the end of the ``revisions.create_revision()`` block, allowing foreign key references to be updated in the same block before the revision data is prepared. However, in some cases you might want to serialize the revision data immediately, such as times when the model is shortly going to be deleted.
 
 ::
 
     from django.db.models.signals import post_save, pre_delete
 
-    reversion.register(YourModel, signals=[post_save], eager_signals=[pre_delete])
+    revisions.register(YourModel, signals=[post_save], eager_signals=[pre_delete])
 
 **Important:** Creating revisions using the `pre_delete` signal is not recommended, as it alters the semantics of revision recovery. Only do this if you have a good understanding of the django-reversion internals.
 
@@ -256,14 +268,14 @@ By default, revision data is serialized at the end of the ``reversion.create_rev
 Really advanced registration
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-It's possible to customize almost every aspect of model registration by registering your model with a subclass of ``reversion.VersionAdapter``. Behind the scenes, ``reversion.register()`` does this anyway, but you can explicitly provide your own VersionAdapter if you need to perform really advanced customization.
+It's possible to customize almost every aspect of model registration by registering your model with a subclass of ``revisions.VersionAdapter``. Behind the scenes, ``revisions.register()`` does this anyway, but you can explicitly provide your own VersionAdapter if you need to perform really advanced customization.
 
 ::
 
-    class MyVersionAdapter(reversion.VersionAdapter):
+    class MyVersionAdapter(revisions.VersionAdapter):
         pass  # Please see the reversion source code for available methods to override.
 
-    reversion.register(MyModel, adapter_cls=MyVersionAdapter)
+    revisions.register(MyModel, adapter_cls=MyVersionAdapter)
 
 
 Automatic Registration by the Admin Interface
@@ -296,8 +308,8 @@ For example::
 
 Since ``Restaurant`` has been registered with a subclass of ``VersionAdmin``, the following registration calls will be made automatically::
 
-    reversion.register(Place)
-    reversion.register(Restaurant, follow=("place_ptr", "meal_set"))
-    reversion.register(Meal)
+    revisions.register(Place)
+    revisions.register(Restaurant, follow=("place_ptr", "meal_set"))
+    revisions.register(Meal)
 
 It is only necessary to manually register these models if you wish to override the default registration parameters. In most cases, however, the defaults will suit just fine.
diff --git a/docs/conf.py b/docs/conf.py
index 03c7ac0..45d3047 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -49,9 +49,9 @@ copyright = '2013, Dave Hall'
 # built documents.
 #
 # The short X.Y version.
-version = '1.9'
+version = '1.10'
 # The full version, including alpha/beta/rc tags.
-release = '1.9.3'
+release = '1.10.0'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/docs/diffs.rst b/docs/diffs.rst
index 4778f30..688ae63 100644
--- a/docs/diffs.rst
+++ b/docs/diffs.rst
@@ -22,10 +22,10 @@ First of all, you need to use the :ref:`low level API <api>` to retrieve the ver
     page = Page.objects.all()[0]
 
     # Get the two versions to compare.
-    available_versions = reversion.get_for_object(page)
+    available_versions = revisions.get_for_object(page)
 
-    old_version = available_versions[0]
-    new_version = available_versions[1]
+    new_version = available_versions[0]
+    old_version = available_versions[1]
 
 Now, in order to generate a text patch::
 
@@ -54,3 +54,5 @@ Admin Integration
 The admin integration for django-reversion does not currently support diff generation.  This is a deliberate design decision, as it would make the framework a lot more heavyweight, as well as carrying the risk of confusing non-technical end users.
 
 While future versions may support a more advanced admin class, for the time being it is left up to your own imagination for ways in which to integrate diffs with your project.
+
+One example might be to use django-reversion-compare, see `django-reversion-compare <https://github.com/jedie/django-reversion-compare>`_.
diff --git a/docs/django-versions.rst b/docs/django-versions.rst
index 573e6ff..9eeebad 100644
--- a/docs/django-versions.rst
+++ b/docs/django-versions.rst
@@ -10,7 +10,7 @@ If you are using anything other than the latest release of Django, it is importa
 ==============  =================
 Django version  Reversion release
 ==============  =================
-1.7+            1.9.3
+1.7+            1.10.0
 1.6+            1.8.5
 1.5.1+          1.7.1
 1.5             1.7
diff --git a/docs/how-it-works.rst b/docs/how-it-works.rst
index bd27c9f..f6da095 100644
--- a/docs/how-it-works.rst
+++ b/docs/how-it-works.rst
@@ -6,19 +6,19 @@ How it works
 Saving Revisions
 ----------------
 
-Enabling version control for a model is achieved using the ``reversion.register`` method. This registers the version control machinery with the ``post_save`` signal for that model, allowing new changes to the model to be caught.
+Enabling version control for a model is achieved using the ``revisions.register`` method. This registers the version control machinery with the ``post_save`` signal for that model, allowing new changes to the model to be caught.
 
 ::
 
-    import reversion
+    from reversion import revisions
 
-    reversion.register(YourModel)
+    revisions.register(YourModel)
 
 Any models that use subclasses of ``VersionAdmin`` in the admin interface will be automatically registered with django-reversion. As such, it is only necessary to manually register these models if you wish to override the default registration settings.
 
 Whenever you save changes to a model, it is serialized using the Django serialization framework into a JSON string. This is saved to the database as a ``reversion.models.Version`` model. Each ``Version`` model is linked to a model instance using a ``GenericForeignKey``.
 
-Foreign keys and many-to-many relationships are normally saved as their primary keys only. However, the ``reversion.register`` method takes an optional follow clause allowing these relationships to be automatically added to revisions. Please see :ref:`Low Level API <api>` for more information.
+Foreign keys and many-to-many relationships are normally saved as their primary keys only. However, the ``revisions.register`` method takes an optional follow clause allowing these relationships to be automatically added to revisions. Please see :ref:`Low Level API <api>` for more information.
 
 Reverting Versions
 ------------------
diff --git a/docs/index.rst b/docs/index.rst
index 9d196b4..f1c4d3c 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -10,9 +10,9 @@ To install django-reversion, follow these steps:
 
 1.  Install with pip: ``pip install django-reversion``.
 2.  Add ``'reversion'`` to ``INSTALLED_APPS``.
-3.  Run ``manage.py syncdb``.
+3.  Run ``manage.py migrate``.
 
-The latest release (1.9.3) of django-reversion is designed to work with Django 1.8. If you have installed anything other than the latest version of Django, please check the :ref:`compatible Django versions <django-versions>` page before installing django-reversion.
+If you have installed anything other than the latest version of Django, please check the :ref:`compatible Django versions <django-versions>` page before installing django-reversion.
 
 There are a number of alternative methods you can use when installing django-reversion. Please check the :ref:`installation methods <installation>` page for more information.
 
@@ -22,9 +22,9 @@ Admin integration
 
 django-reversion can be used to add a powerful rollback and recovery facility to your admin site. To enable this, simply register your models with a subclass of ``reversion.VersionAdmin``::
 
-    import reversion
+    from reversion.admin import VersionAdmin
 
-    class YourModelAdmin(reversion.VersionAdmin):
+    class YourModelAdmin(VersionAdmin):
 
         pass
 
diff --git a/docs/signals.rst b/docs/signals.rst
index 2499059..aff7125 100644
--- a/docs/signals.rst
+++ b/docs/signals.rst
@@ -5,10 +5,9 @@ Signals sent by django-reversion
 
 django-reversion provides a number of custom signals that can be used to tie-in additional functionality to the version creation mechanism.
 
-**Important:** Don't connect to the pre_save or post_save signals of the Version or Revision models directly, use the signals outlined below instead. The pre_save and post_save signals are no longer sent by the Version or Revision models since django-reversion 1.7.
 
-reversion.pre_revision_commit
------------------------------
+reversion.signals.pre_revision_commit
+-------------------------------------
 
 This signal is triggered just before a revision is saved to the database. It receives the following keyword arguments:
 
@@ -17,8 +16,8 @@ This signal is triggered just before a revision is saved to the database. It rec
 * **versions** - The unsaved Version models in the revision.
 
 
-reversion.post_revision_commit
-------------------------------
+reversion.signals..post_revision_commit
+---------------------------------------
 
 This signal is triggered just after a revision is saved to the database. It receives the following keyword arguments:
 
diff --git a/setup.py b/setup.py
index a9d2374..e285854 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
 import sys
-sys.path.insert(0, 'src/reversion')
+sys.path.insert(0, "src")
 from setuptools import setup, find_packages
-from version import __version__
+from reversion import __version__
 
 
 # Load in babel support, if available.
diff --git a/src/reversion/__init__.py b/src/reversion/__init__.py
index ca6cc7e..c0af08d 100644
--- a/src/reversion/__init__.py
+++ b/src/reversion/__init__.py
@@ -8,46 +8,5 @@ Developed by Dave Hall.
 
 from __future__ import unicode_literals
 
-from reversion.revisions import default_revision_manager, revision_context_manager, VersionAdapter
-from reversion.admin import VersionAdmin
-from reversion.models import pre_revision_commit, post_revision_commit
-from reversion.version import __version__ 
 
-
-VERSION = __version__ 
-
-
-# Legacy revision reference.
-revision = default_revision_manager  # TODO: Deprecate eventually.
-
-
-# Easy registration methods.
-register = default_revision_manager.register
-is_registered = default_revision_manager.is_registered
-unregister = default_revision_manager.unregister
-get_adapter = default_revision_manager.get_adapter
-get_registered_models = default_revision_manager.get_registered_models
-
-
... 1267 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-reversion.git



More information about the Python-modules-commits mailing list