summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-10-04 11:29:13 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-10-04 11:30:48 +0200
commitcd01ae68c033115328003658c666bdb082f485bf (patch)
tree5c00627c49f90a62627a283f8d131c2c25a5619d /ishtar_common/models.py
parent50bbd5bbddd28d0c80eacd2665126945a44dff27 (diff)
downloadIshtar-cd01ae68c033115328003658c666bdb082f485bf.tar.bz2
Ishtar-cd01ae68c033115328003658c666bdb082f485bf.zip
Preservation module: add fields to models (refs #3639)
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index b0b050c6c..28a24115b 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -765,6 +765,22 @@ class GeneralType(Cached, models.Model):
item.generate_key()
+class HierarchicalType(GeneralType):
+ parent = models.ForeignKey('self', blank=True, null=True,
+ verbose_name=_(u"Parent"))
+
+ class Meta:
+ abstract = True
+
+ def full_label(self):
+ lbls = [self.label]
+ item = self
+ while item.parent:
+ item = item.parent
+ lbls.append(item.label)
+ return u" > ".join(reversed(lbls))
+
+
class ItemKey(models.Model):
key = models.CharField(_(u"Key"), max_length=100)
content_type = models.ForeignKey(ContentType)
@@ -1255,6 +1271,8 @@ class IshtarSiteProfile(models.Model, Cached):
warehouse_color = models.CharField(
_(u"CSS code for warehouse module"), default=u'rgba(10,20,200,0.15)',
max_length=200)
+ preservation = models.BooleanField(_(u"Preservation module"),
+ default=False)
mapping = models.BooleanField(_(u"Mapping module"), default=False)
mapping_color = models.CharField(
_(u"CSS code for mapping module"), default=u'rgba(72, 236, 0, 0.15)',