summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-07-17 23:22:35 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-07-17 23:22:35 +0200
commitda0282bd175dac6a704c36c9321a9348f1d43dd0 (patch)
tree015cb51476f6ca65d4ea54312d4618a1d5d9bdea /ishtar_common/models.py
parentca37b5b8f5be55b6172b7e3c6463a75f5380b36d (diff)
parent0bfc89df0581dc5e0cc748629081fd5da3ae9271 (diff)
downloadIshtar-da0282bd175dac6a704c36c9321a9348f1d43dd0.tar.bz2
Ishtar-da0282bd175dac6a704c36c9321a9348f1d43dd0.zip
Merge branch 'v0.9' into wheezy
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index d8948d3e3..bbd2923a0 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -728,6 +728,8 @@ class BaseHistorizedItem(Imported):
class GeneralRelationType(GeneralType):
order = models.IntegerField(_(u"Order"), default=1)
symmetrical = models.BooleanField(_(u"Symmetrical"))
+ tiny_label = models.CharField(_(u"Tiny label"), max_length=50,
+ blank=True, null=True)
# # an inverse must be set
# inverse_relation = models.ForeignKey(
# 'RelationType', verbose_name=_(u"Inverse relation"), blank=True,
@@ -742,6 +744,9 @@ class GeneralRelationType(GeneralType):
raise ValidationError(
_(u"Cannot have symmetrical and an inverse_relation"))
+ def get_tiny_label(self):
+ return self.tiny_label or self.label or u""
+
def save(self, *args, **kwargs):
obj = super(GeneralRelationType, self).save(*args, **kwargs)
# after saving check that the inverse_relation of the inverse_relation