diff options
Diffstat (limited to 'ishtar_common/models.py')
| -rw-r--r-- | ishtar_common/models.py | 18 | 
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)',  | 
