From 5b9cb1205998288f90e09496847aafa47097715b Mon Sep 17 00:00:00 2001 From: Luke Hatcher Date: Sun, 5 Feb 2012 22:30:14 -0500 Subject: [PATCH] hook up django reversion --- symposion_project/apps/cms/models.py | 4 ++++ symposion_project/settings.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/symposion_project/apps/cms/models.py b/symposion_project/apps/cms/models.py index 7a72cc1d..0f0d635c 100644 --- a/symposion_project/apps/cms/models.py +++ b/symposion_project/apps/cms/models.py @@ -10,6 +10,8 @@ from taggit.managers import TaggableManager from mptt.models import MPTTModel, TreeForeignKey from mptt.utils import drilldown_tree_for_node +import reversion + class ContentBase(models.Model): @@ -60,6 +62,8 @@ class Page(MPTTModel, ContentBase): class MPTTMeta: order_insertion_by = ["ordering", "title"] +reversion.register(Page) + class MenuItem(MPTTModel): diff --git a/symposion_project/settings.py b/symposion_project/settings.py index 68511eab..feb5b410 100644 --- a/symposion_project/settings.py +++ b/symposion_project/settings.py @@ -108,6 +108,8 @@ MIDDLEWARE_CLASSES = [ "django_openid.consumer.SessionConsumer", "django.contrib.messages.middleware.MessageMiddleware", "pinax.apps.account.middleware.LocaleMiddleware", + "django.middleware.transaction.TransactionMiddleware", + "reversion.middleware.RevisionMiddleware", "pinax.middleware.security.HideSensistiveFieldsMiddleware", "debug_toolbar.middleware.DebugToolbarMiddleware", ] @@ -163,6 +165,7 @@ INSTALLED_APPS = [ "taggit", "cms", "mptt", + "reversion", # Pinax "pinax.apps.account",