summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index ac639168c..dfcf503af 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -58,6 +58,9 @@ from secretary import Renderer as SecretaryRenderer
from simple_history.models import HistoricalRecords as BaseHistoricalRecords
from unidecode import unidecode
+from ishtar_common.alternative_configs import ALTERNATE_CONFIGS, \
+ ALTERNATE_CONFIGS_CHOICES
+
from ishtar_common.model_merging import merge_model_objects
from ishtar_common.models_imports import ImporterModel, ImporterType, \
ImporterDefault, ImporterDefaultValues, ImporterColumn, \
@@ -1703,6 +1706,13 @@ class IshtarSiteProfile(models.Model, Cached):
experimental_feature = models.BooleanField(
_(u"Activate experimental feature"), default=False)
description = models.TextField(_(u"Description"), null=True, blank=True)
+ config = models.CharField(
+ _(u"Alternate configuration"), max_length=200,
+ choices=ALTERNATE_CONFIGS_CHOICES,
+ help_text=_(u"Choose an alternate configuration for label, "
+ u"index management"),
+ null=True, blank=True
+ )
files = models.BooleanField(_(u"Files module"), default=False)
archaeological_site = models.BooleanField(
_(u"Archaeological site module"), default=False)
@@ -1814,6 +1824,10 @@ class IshtarSiteProfile(models.Model, Cached):
def __unicode__(self):
return unicode(self.label)
+ def has_overload(self, key):
+ return self.config and self.config in ALTERNATE_CONFIGS and \
+ hasattr(ALTERNATE_CONFIGS[self.config], key)
+
@classmethod
def get_current_profile(cls, force=False):
cache_key, value = get_cache(cls, ['is-current-profile'])