diff options
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 31266c43..20dcfd98 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 53085fb1..277623f8 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 e6ce41fb..17c3efe7 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 138d89dd..6f41aa4e 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 4202f618..c3701d94 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 96195471..b62d2ca7 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 bdbdfa55..74bc7cae 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 168ad067..9c9dd961 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 8173f2c1..a69196a5 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 a2553c63..11b90e40 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 76d483d8..c65346d2 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 0f97b7cb..1563f92d 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 80515a6c..c203e83a 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 a170c959..b98251f0 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 1fa9a1b8..05570fc2 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 fba5208a..6a4d7f1c 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 1404449c..54fd939c 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 7786af19..5ba20f32 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 929b028e..c719082c 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 952beec6..75f9f80a 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 3e7f6e12..781343b4 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 c1f03d9f..c44db82b 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 b35ad6c0..305bb46e 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 a6a8fd2c..cebd6969 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 6e9dd3e4..49f2c5d0 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 bb24fc75..f110bac1 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 aaf784e5..f55bd05b 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 c98a0d78..fe95d8db 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 72a795b1..1862de31 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 8f112ef4..7009afb6 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 5da162b5..6018236d 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 374f9a8c..37e1a33e 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 8a128563..7041db0f 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 08369363..d9bc092c 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 |