Skip to content

Commit

Permalink
Update for django-reversion 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Shannon committed Aug 18, 2016
1 parent 304bb18 commit 62699ea
Show file tree
Hide file tree
Showing 24 changed files with 348 additions and 398 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ env:
- DJANGO='1.8' REVERSION='1.9' EXTRA=''
- DJANGO='1.8' REVERSION='1.10' EXTRA=''
- DJANGO='1.9' REVERSION='1.10' EXTRA=''
- DJANGO='1.9' REVERSION='2.0' EXTRA=''
- DJANGO='1.8' REVERSION='1.9' EXTRA='diff-match-patch'
- DJANGO='1.8' REVERSION='1.10' EXTRA='diff-match-patch'
- DJANGO='1.8' REVERSION='1.10' EXTRA='diff-match-patch'
- DJANGO='1.9' REVERSION='1.10' EXTRA='diff-match-patch'
- DJANGO='1.9' REVERSION='2.0' EXTRA='diff-match-patch'

install:
- pip install --upgrade pip
Expand Down
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ CONTRIBUTORS are and/or have been (alphabetic order):
Github: <https://github.com/amureki>
* Spencer, Samuel
Github: <https://github.com/LegoStormtroopr>
* Shannon, Michael
Github: <https://github.com/mshannon1123>
* C. Barrionuevo da Luz, Fabio
Github: <https://github.com/luzfcb>
* Wickström, Frank
Expand Down
12 changes: 6 additions & 6 deletions reversion_compare/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from django.contrib import admin
try:
from django.contrib.admin.utils import unquote, quote
except ImportError: # Django < 1.7
except ImportError: # Django < 1.7 # pragma: no cover
from django.contrib.admin.util import unquote, quote
from django.core.urlresolvers import reverse
from django.http import Http404
Expand All @@ -29,12 +29,12 @@
from django.utils.translation import ugettext as _

try:
from reversion import revisions as reversion # django-reversion >= 1.10
from reversion import revisions as reversion # django-reversion >= 1.10
except ImportError:
import reversion # django-reversion <= 1.9
import reversion # django-reversion <= 1.9

from reversion.admin import VersionAdmin

from reversion_compare import reversion_api
from reversion_compare.forms import SelectDiffForm
from reversion_compare.mixins import CompareMixin, CompareMethodsMixin

Expand Down Expand Up @@ -111,7 +111,7 @@ def _get_action_list(self, request, object_id, extra_context=None):
args=(quote(version.object_id), version.id)),
}
for version
in self._order_version_queryset(self.revision_manager.get_for_object_reference(
in self._order_version_queryset(reversion_api.get_for_object_reference(
self.model,
object_id,
).select_related("revision__user"))
Expand Down Expand Up @@ -168,7 +168,7 @@ def compare_view(self, request, object_id, extra_context=None):

object_id = unquote(object_id) # Underscores in primary key get quoted to "_5F"
obj = get_object_or_404(self.model, pk=object_id)
queryset = self.revision_manager.get_for_object(obj)
queryset = reversion_api.get_for_object(obj)
version1 = get_object_or_404(queryset, pk=version_id1)
version2 = get_object_or_404(queryset, pk=version_id2)

Expand Down
Loading

0 comments on commit 62699ea

Please sign in to comment.