Author: leidel
Date: Wed Jan 21 02:29:26 2009
New Revision: 91

Modified:
    trunk/dbtemplates/admin.py

Log:
Look in INSTALLED_APPS to find out if django-reversion is installed

Modified: trunk/dbtemplates/admin.py
==============================================================================
--- trunk/dbtemplates/admin.py  (original)
+++ trunk/dbtemplates/admin.py  Wed Jan 21 02:29:26 2009
@@ -1,17 +1,15 @@
  from django import forms
+from django.conf import settings
  from django.contrib import admin
-from django.db.models import get_app
  from django.utils.translation import gettext_lazy as _
-from django.core.exceptions import ImproperlyConfigured

  from dbtemplates.models import Template

  # Check if django-reversion is installed and use reversions' VersionAdmin
  # as the base admin class if yes
-try:
-    get_app('reversion')
+if 'reversion'in settings.INSTALLED_APS:
      from reversion.admin import VersionAdmin as TemplateModelAdmin
-except ImproperlyConfigured:
+else:
      from django.contrib.admin import ModelAdmin as TemplateModelAdmin

  class TemplateAdminForm(forms.ModelForm):

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to