Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move reversion registration into admin

  • Loading branch information...
commit 5ee97a9ce739ad421198551c330d779499864f92 1 parent e8f15f7
@paltman paltman authored
Showing with 7 additions and 6 deletions.
  1. +7 −1 boxes/admin.py
  2. +0 −5 boxes/models.py
View
8 boxes/admin.py
@@ -1,6 +1,12 @@
from django.contrib import admin
+import reversion
+
from boxes.models import Box
-admin.site.register(Box)
+class BoxAdmin(reversion.VersionAdmin):
+ search_fields = ["content"]
+
+
+admin.site.register(Box, BoxAdmin)
View
5 boxes/models.py
@@ -4,8 +4,6 @@
from django.contrib.auth.models import User
-import reversion
-
class Box(models.Model):
@@ -21,6 +19,3 @@ def __unicode__(self):
class Meta:
verbose_name_plural = "boxes"
-
-
-reversion.register(Box)
Please sign in to comment.
Something went wrong with that request. Please try again.