Skip to content

Commit

Permalink
Merge branch 'master' of github.com:etianen/django-reversion
Browse files Browse the repository at this point in the history
  • Loading branch information
etianen committed Aug 4, 2015
2 parents da2acbc + 702873f commit dd7826d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
5 changes: 2 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ commands:

::

$ pip install django
$ pip install -e .
$ python src/tests/runtests.py
$ pip install -e .[test]
$ coverage run src/tests/manage.py test src/tests/test_reversion/

The django-reversion project is built on every push with `Travis CI <https://travis-ci.org/etianen/django-reversion>`_.

Expand Down
12 changes: 12 additions & 0 deletions docs/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,15 @@ This command is used to create a single, base revision for all registered models
django-admin.py createinitialrevisions
django-admin.py createinitialrevisions someapp
django-admin.py createinitialrevisions someapp.SomeModel

deleterevisions
----------------------

This command is used to delete old revisions. It can be run regularly to keep storage requirements of models history sane. You can specify to delete revisions older than N days or delete only revisions older than the specified date or keep only the N most recent revisions for each object.

::

django-admin.py deleterevisions myapp
django-admin.py deleterevisions --date=2015-01-15
django-admin.py deleterevisions myapp.mymodel --days=365 --force
django-admin.py deleterevisions myapp.mymodel --keep=10
4 changes: 3 additions & 1 deletion src/reversion/revisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,9 @@ def get_unique_for_object(self, obj, db=None):
The results are returned with the most recent versions first.
"""
warnings.warn(PendingDeprecationWarning, "Use get_for_object().get_unique() instead of get_unique_for_object().")
warnings.warn(
"Use get_for_object().get_unique() instead of get_unique_for_object().",
PendingDeprecationWarning)
return list(self.get_for_object(obj, db).get_unique())

def get_for_date(self, object, date, db=None):
Expand Down

0 comments on commit dd7826d

Please sign in to comment.