diff options
author | Kabir <kabir@gnowledge.org> | 2012-05-17 14:18:52 +0530 |
---|---|---|
committer | Kabir <kabir@gnowledge.org> | 2012-05-17 14:18:52 +0530 |
commit | ff3302db35cf7689e2abc0f52d5058c974925784 (patch) | |
tree | dd756ef832cd4ed34c8cd2484525f4eab8956b51 /gstudio/admin | |
parent | 33bcefd3e0a7dec7e16aa03a9133fab633e1e624 (diff) | |
download | gnowsys-ff3302db35cf7689e2abc0f52d5058c974925784.tar.gz |
Admin files with modifications for disabling versioning added
Diffstat (limited to 'gstudio/admin')
34 files changed, 210 insertions, 42 deletions
diff --git a/gstudio/admin/attribute.py b/gstudio/admin/attribute.py index 31266c4..20dcfd9 100644 --- a/gstudio/admin/attribute.py +++ b/gstudio/admin/attribute.py @@ -7,8 +7,14 @@ from gstudio.admin.forms import AttributeAdminForm from gstudio.models import * import reversion from django.template.defaultfilters import slugify +from gstudio.settings import GSTUDIO_VERSIONING -class AttributeAdmin(reversion.VersionAdmin): +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin + +class AttributeAdmin(parent_class): fieldsets=((_('Attribute'),{'fields': ('attributetype','attributetype_scope','subject','subject_scope','svalue','value_scope')}), ) diff --git a/gstudio/admin/attribute_bigintegerfield.py b/gstudio/admin/attribute_bigintegerfield.py index 53085fb..277623f 100644 --- a/gstudio/admin/attribute_bigintegerfield.py +++ b/gstudio/admin/attribute_bigintegerfield.py @@ -1,9 +1,13 @@ from django.contrib import admin from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ +from gstudio.settings import GSTUDIO_VERSIONING from gstudio.admin.forms import AttributeBigIntegerFieldAdminForm import reversion - -class AttributeBigIntegerFieldAdmin(reversion.VersionAdmin): +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin +class AttributeBigIntegerFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_booleanfield.py b/gstudio/admin/attribute_booleanfield.py index e6ce41f..17c3efe 100644 --- a/gstudio/admin/attribute_booleanfield.py +++ b/gstudio/admin/attribute_booleanfield.py @@ -3,7 +3,11 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeBooleanFieldAdminForm +from gstudio.settings import GSTUDIO_VERSIONING import reversion - -class AttributeBooleanFieldAdmin(reversion.VersionAdmin): +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin +class AttributeBooleanFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_charfield.py b/gstudio/admin/attribute_charfield.py index 138d89d..6f41aa4 100644 --- a/gstudio/admin/attribute_charfield.py +++ b/gstudio/admin/attribute_charfield.py @@ -1,10 +1,14 @@ from django.contrib import admin from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ - +from gstudio.settings import GSTUDIO_VERSIONING from gstudio.admin.forms import AttributeCharFieldAdminForm import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeCharFieldAdmin(reversion.VersionAdmin): +class AttributeCharFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_commaseparatedintegerfield.py b/gstudio/admin/attribute_commaseparatedintegerfield.py index 4202f61..c3701d9 100644 --- a/gstudio/admin/attribute_commaseparatedintegerfield.py +++ b/gstudio/admin/attribute_commaseparatedintegerfield.py @@ -3,7 +3,12 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeCommaSeparatedIntegerFieldAdminForm +from gstudio.settings import GSTUDIO_VERSIONING import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeCommaSeparatedIntegerFieldAdmin(reversion.VersionAdmin): +class AttributeCommaSeparatedIntegerFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_datefield.py b/gstudio/admin/attribute_datefield.py index 9619547..b62d2ca 100644 --- a/gstudio/admin/attribute_datefield.py +++ b/gstudio/admin/attribute_datefield.py @@ -3,7 +3,12 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeDateFieldAdminForm +from gstudio.settings import GSTUDIO_VERSIONING import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeDateFieldAdmin(reversion.VersionAdmin): +class AttributeDateFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_datetimefield.py b/gstudio/admin/attribute_datetimefield.py index bdbdfa5..74bc7ca 100644 --- a/gstudio/admin/attribute_datetimefield.py +++ b/gstudio/admin/attribute_datetimefield.py @@ -3,7 +3,12 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeDateTimeFieldAdminForm +from gstudio.settings import GSTUDIO_VERSIONING import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeDateTimeFieldAdmin(reversion.VersionAdmin): +class AttributeDateTimeFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_decimalfield.py b/gstudio/admin/attribute_decimalfield.py index 168ad06..9c9dd96 100644 --- a/gstudio/admin/attribute_decimalfield.py +++ b/gstudio/admin/attribute_decimalfield.py @@ -3,7 +3,12 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeDecimalFieldAdminForm +from gstudio.settings import GSTUDIO_VERSIONING import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeDecimalFieldAdmin(reversion.VersionAdmin): +class AttributeDecimalFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_emailfield.py b/gstudio/admin/attribute_emailfield.py index 8173f2c..a69196a 100644 --- a/gstudio/admin/attribute_emailfield.py +++ b/gstudio/admin/attribute_emailfield.py @@ -3,7 +3,12 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeEmailFieldAdminForm +from gstudio.settings import GSTUDIO_VERSIONING import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeEmailFieldAdmin(reversion.VersionAdmin): +class AttributeEmailFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_filefield.py b/gstudio/admin/attribute_filefield.py index a2553c6..11b90e4 100644 --- a/gstudio/admin/attribute_filefield.py +++ b/gstudio/admin/attribute_filefield.py @@ -3,7 +3,12 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeFileFieldAdminForm +from gstudio.settings import GSTUDIO_VERSIONING import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeFileFieldAdmin(reversion.VersionAdmin): +class AttributeFileFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_filepathfield.py b/gstudio/admin/attribute_filepathfield.py index 76d483d..c65346d 100644 --- a/gstudio/admin/attribute_filepathfield.py +++ b/gstudio/admin/attribute_filepathfield.py @@ -3,7 +3,12 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeFilePathFieldAdminForm +from gstudio.settings import GSTUDIO_VERSIONING import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeFilePathFieldAdmin(reversion.VersionAdmin): +class AttributeFilePathFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_floatfield.py b/gstudio/admin/attribute_floatfield.py index 0f97b7c..1563f92 100644 --- a/gstudio/admin/attribute_floatfield.py +++ b/gstudio/admin/attribute_floatfield.py @@ -3,7 +3,12 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeFloatFieldAdminForm +from gstudio.settings import GSTUDIO_VERSIONING import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeFloatFieldAdmin(reversion.VersionAdmin): +class AttributeFloatFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_imagefield.py b/gstudio/admin/attribute_imagefield.py index 80515a6..c203e83 100644 --- a/gstudio/admin/attribute_imagefield.py +++ b/gstudio/admin/attribute_imagefield.py @@ -3,7 +3,12 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeImageFieldAdminForm +from gstudio.settings import GSTUDIO_VERSIONING import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeImageFieldAdmin(reversion.VersionAdmin): +class AttributeImageFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_integerfield.py b/gstudio/admin/attribute_integerfield.py index a170c95..b98251f 100644 --- a/gstudio/admin/attribute_integerfield.py +++ b/gstudio/admin/attribute_integerfield.py @@ -3,7 +3,13 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeIntegerFieldAdminForm +from gstudio.settings import GSTUDIO_VERSIONING import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeIntegerFieldAdmin(reversion.VersionAdmin): + +class AttributeIntegerFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_ipaddressfield.py b/gstudio/admin/attribute_ipaddressfield.py index 1fa9a1b..05570fc 100644 --- a/gstudio/admin/attribute_ipaddressfield.py +++ b/gstudio/admin/attribute_ipaddressfield.py @@ -3,7 +3,12 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeIPAddressFieldAdminForm +from gstudio.settings import GSTUDIO_VERSIONING import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeIPAddressFieldAdmin(reversion.VersionAdmin): +class AttributeIPAddressFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_nullbooleanfield.py b/gstudio/admin/attribute_nullbooleanfield.py index fba5208..6a4d7f1 100644 --- a/gstudio/admin/attribute_nullbooleanfield.py +++ b/gstudio/admin/attribute_nullbooleanfield.py @@ -3,7 +3,12 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeNullBooleanFieldAdminForm +from gstudio.settings import GSTUDIO_VERSIONING import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeNullBooleanFieldAdmin(reversion.VersionAdmin): +class AttributeNullBooleanFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_positiveintegerfield.py b/gstudio/admin/attribute_positiveintegerfield.py index 1404449..54fd939 100644 --- a/gstudio/admin/attribute_positiveintegerfield.py +++ b/gstudio/admin/attribute_positiveintegerfield.py @@ -3,7 +3,12 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributePositiveIntegerFieldAdminForm +from gstudio.settings import GSTUDIO_VERSIONING import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributePositiveIntegerFieldAdmin(reversion.VersionAdmin): +class AttributePositiveIntegerFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_textfield.py b/gstudio/admin/attribute_textfield.py index 7786af1..5ba20f3 100644 --- a/gstudio/admin/attribute_textfield.py +++ b/gstudio/admin/attribute_textfield.py @@ -4,6 +4,11 @@ from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeTextFieldAdminForm import reversion +from gstudio.settings import GSTUDIO_VERSIONING +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeTextFieldAdmin(reversion.VersionAdmin): +class AttributeTextFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_timefield.py b/gstudio/admin/attribute_timefield.py index 929b028..c719082 100644 --- a/gstudio/admin/attribute_timefield.py +++ b/gstudio/admin/attribute_timefield.py @@ -4,6 +4,11 @@ from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeTimeFieldAdminForm import reversion +from gstudio.settings import GSTUDIO_VERSIONING +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeTimeFieldAdmin(reversion.VersionAdmin): +class AttributeTimeFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attribute_urlfield.py b/gstudio/admin/attribute_urlfield.py index 952beec..75f9f80 100644 --- a/gstudio/admin/attribute_urlfield.py +++ b/gstudio/admin/attribute_urlfield.py @@ -4,6 +4,11 @@ from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeURLFieldAdminForm import reversion +from gstudio.settings import GSTUDIO_VERSIONING +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeURLFieldAdmin(reversion.VersionAdmin): +class AttributeURLFieldAdmin(parent_class): pass diff --git a/gstudio/admin/attributespecification.py b/gstudio/admin/attributespecification.py index 3e7f6e1..781343b 100644 --- a/gstudio/admin/attributespecification.py +++ b/gstudio/admin/attributespecification.py @@ -4,7 +4,12 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import AttributeSpecificationAdminForm +from gstudio.settings import GSTUDIO_VERSIONING import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class AttributeSpecificationAdmin(reversion.VersionAdmin): +class AttributeSpecificationAdmin(parent_class): pass diff --git a/gstudio/admin/attributetype.py b/gstudio/admin/attributetype.py index c1f03d9..c44db82 100644 --- a/gstudio/admin/attributetype.py +++ b/gstudio/admin/attributetype.py @@ -20,11 +20,15 @@ from gstudio.managers import HIDDEN from gstudio.managers import PUBLISHED from gstudio.ping import DirectoryPinger from gstudio.admin.forms import AttributetypeAdminForm +from gstudio.settings import GSTUDIO_VERSIONING +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin - -class AttributetypeAdmin(reversion.VersionAdmin): +class AttributetypeAdmin(parent_class): """Admin for Attributetype model""" form = AttributetypeAdminForm date_hierarchy = 'creation_date' diff --git a/gstudio/admin/complement.py b/gstudio/admin/complement.py index b35ad6c..305bb46 100644 --- a/gstudio/admin/complement.py +++ b/gstudio/admin/complement.py @@ -4,6 +4,11 @@ from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import ComplementAdminForm import reversion +from gstudio.settings import GSTUDIO_VERSIONING +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class ComplementAdmin(reversion.VersionAdmin): +class ComplementAdmin(parent_class): pass diff --git a/gstudio/admin/expression.py b/gstudio/admin/expression.py index a6a8fd2..cebd696 100644 --- a/gstudio/admin/expression.py +++ b/gstudio/admin/expression.py @@ -5,8 +5,13 @@ from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import ExpressionAdminForm import reversion +from gstudio.settings import GSTUDIO_VERSIONING +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class ExpressionAdmin(reversion.VersionAdmin): +class ExpressionAdmin(parent_class): def save_model(self, request, expression, form, change): expression.title = expression.composed_sentence expression.save() diff --git a/gstudio/admin/intersection.py b/gstudio/admin/intersection.py index 6e9dd3e..49f2c5d 100644 --- a/gstudio/admin/intersection.py +++ b/gstudio/admin/intersection.py @@ -4,6 +4,11 @@ from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import IntersectionAdminForm import reversion +from gstudio.settings import GSTUDIO_VERSIONING +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class IntersectionAdmin(reversion.VersionAdmin): +class IntersectionAdmin(parent_class): pass diff --git a/gstudio/admin/metatype.py b/gstudio/admin/metatype.py index bb24fc7..f110bac 100644 --- a/gstudio/admin/metatype.py +++ b/gstudio/admin/metatype.py @@ -5,8 +5,13 @@ from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import MetatypeAdminForm import reversion +from gstudio.settings import GSTUDIO_VERSIONING +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class MetatypeAdmin(reversion.VersionAdmin): +class MetatypeAdmin(parent_class): """Admin for Metatype model""" form = MetatypeAdminForm fields = ('title','altnames', 'parent', 'description', 'slug') diff --git a/gstudio/admin/nodespecification.py b/gstudio/admin/nodespecification.py index aaf784e..f55bd05 100644 --- a/gstudio/admin/nodespecification.py +++ b/gstudio/admin/nodespecification.py @@ -4,6 +4,11 @@ from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import NodeSpecificationAdminForm import reversion +from gstudio.settings import GSTUDIO_VERSIONING +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class NodeSpecificationAdmin(reversion.VersionAdmin): +class NodeSpecificationAdmin(parent_class): pass diff --git a/gstudio/admin/objecttype.py b/gstudio/admin/objecttype.py index c98a0d7..fe95d8d 100644 --- a/gstudio/admin/objecttype.py +++ b/gstudio/admin/objecttype.py @@ -14,16 +14,22 @@ from django.core.urlresolvers import reverse, NoReverseMatch from tagging.models import Tag import reversion + from gstudio import settings from gstudio.managers import HIDDEN from gstudio.managers import PUBLISHED from gstudio.ping import DirectoryPinger from gstudio.admin.forms import ObjecttypeAdminForm +from gstudio.settings import GSTUDIO_VERSIONING +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class ObjecttypeAdmin(reversion.VersionAdmin): +class ObjecttypeAdmin(parent_class): """Admin for Objecttype model""" form = ObjecttypeAdminForm date_hierarchy = 'creation_date' diff --git a/gstudio/admin/processtype.py b/gstudio/admin/processtype.py index 72a795b..1862de3 100644 --- a/gstudio/admin/processtype.py +++ b/gstudio/admin/processtype.py @@ -20,11 +20,14 @@ from gstudio.managers import HIDDEN from gstudio.managers import PUBLISHED from gstudio.ping import DirectoryPinger from gstudio.admin.forms import ProcesstypeAdminForm +from gstudio.settings import GSTUDIO_VERSIONING - - -class ProcesstypeAdmin(reversion.VersionAdmin): +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin +class ProcesstypeAdmin(parent_class): """Admin for Processtype model""" form = ProcesstypeAdminForm date_hierarchy = 'creation_date' diff --git a/gstudio/admin/relation.py b/gstudio/admin/relation.py index 8f112ef..7009afb 100644 --- a/gstudio/admin/relation.py +++ b/gstudio/admin/relation.py @@ -6,8 +6,14 @@ from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import RelationAdminForm import reversion from django.template.defaultfilters import slugify +from gstudio.settings import GSTUDIO_VERSIONING -class RelationAdmin(reversion.VersionAdmin): +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin + +class RelationAdmin(parent_class): fieldsets=((_('Relation'),{'fields': ('relationtype','relationtype_scope','left_subject' ,'left_subject_scope','right_subject','right_subject_scope')}), ) diff --git a/gstudio/admin/relationspecification.py b/gstudio/admin/relationspecification.py index 5da162b..6018236 100644 --- a/gstudio/admin/relationspecification.py +++ b/gstudio/admin/relationspecification.py @@ -4,6 +4,12 @@ from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import RelationSpecificationAdminForm import reversion +from gstudio.settings import GSTUDIO_VERSIONING -class RelationSpecificationAdmin(reversion.VersionAdmin): +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin + +class RelationSpecificationAdmin(parent_class): pass diff --git a/gstudio/admin/relationtype.py b/gstudio/admin/relationtype.py index 374f9a8..37e1a33 100644 --- a/gstudio/admin/relationtype.py +++ b/gstudio/admin/relationtype.py @@ -19,11 +19,15 @@ from gstudio.managers import HIDDEN from gstudio.managers import PUBLISHED from gstudio.ping import DirectoryPinger from gstudio.admin.forms import RelationtypeAdminForm +from gstudio.settings import GSTUDIO_VERSIONING +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin - -class RelationtypeAdmin(reversion.VersionAdmin): +class RelationtypeAdmin(parent_class): """Admin for Relationtype model""" form = RelationtypeAdminForm date_hierarchy = 'creation_date' diff --git a/gstudio/admin/systemtype.py b/gstudio/admin/systemtype.py index 8a12856..7041db0 100644 --- a/gstudio/admin/systemtype.py +++ b/gstudio/admin/systemtype.py @@ -20,11 +20,15 @@ from gstudio.managers import HIDDEN from gstudio.managers import PUBLISHED from gstudio.ping import DirectoryPinger from gstudio.admin.forms import SystemtypeAdminForm +from gstudio.settings import GSTUDIO_VERSIONING +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin - -class SystemtypeAdmin(reversion.VersionAdmin): +class SystemtypeAdmin(parent_class): """Admin for Systemtype model""" form = SystemtypeAdminForm date_hierarchy = 'creation_date' diff --git a/gstudio/admin/union.py b/gstudio/admin/union.py index 0836936..d9bc092 100644 --- a/gstudio/admin/union.py +++ b/gstudio/admin/union.py @@ -3,7 +3,13 @@ from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ from gstudio.admin.forms import UnionAdminForm +from gstudio.settings import GSTUDIO_VERSIONING + import reversion +if GSTUDIO_VERSIONING == True: + parent_class = reversion.VersionAdmin +else: + parent_class = admin.ModelAdmin -class UnionAdmin(reversion.VersionAdmin): +class UnionAdmin(parent_class): pass |