hook up django reversion

This commit is contained in:
Luke Hatcher 2012-02-05 22:30:14 -05:00
parent 99aea4856d
commit 5b9cb12059
2 changed files with 7 additions and 0 deletions

View file

@ -10,6 +10,8 @@ from taggit.managers import TaggableManager
from mptt.models import MPTTModel, TreeForeignKey from mptt.models import MPTTModel, TreeForeignKey
from mptt.utils import drilldown_tree_for_node from mptt.utils import drilldown_tree_for_node
import reversion
class ContentBase(models.Model): class ContentBase(models.Model):
@ -60,6 +62,8 @@ class Page(MPTTModel, ContentBase):
class MPTTMeta: class MPTTMeta:
order_insertion_by = ["ordering", "title"] order_insertion_by = ["ordering", "title"]
reversion.register(Page)
class MenuItem(MPTTModel): class MenuItem(MPTTModel):

View file

@ -108,6 +108,8 @@ MIDDLEWARE_CLASSES = [
"django_openid.consumer.SessionConsumer", "django_openid.consumer.SessionConsumer",
"django.contrib.messages.middleware.MessageMiddleware", "django.contrib.messages.middleware.MessageMiddleware",
"pinax.apps.account.middleware.LocaleMiddleware", "pinax.apps.account.middleware.LocaleMiddleware",
"django.middleware.transaction.TransactionMiddleware",
"reversion.middleware.RevisionMiddleware",
"pinax.middleware.security.HideSensistiveFieldsMiddleware", "pinax.middleware.security.HideSensistiveFieldsMiddleware",
"debug_toolbar.middleware.DebugToolbarMiddleware", "debug_toolbar.middleware.DebugToolbarMiddleware",
] ]
@ -163,6 +165,7 @@ INSTALLED_APPS = [
"taggit", "taggit",
"cms", "cms",
"mptt", "mptt",
"reversion",
# Pinax # Pinax
"pinax.apps.account", "pinax.apps.account",