From ccd858622c1ef161b355f020055682c6e424ad98 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 17 Dec 2013 13:40:51 +0100 Subject: Organizations management (refs #1568) * select, create, modify forms * create, modify, wizard * sheet templates * associated actions, urls --- ishtar_common/models.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 77a7d6562..473d634fa 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -701,6 +701,7 @@ class OrganizationType(GeneralType): ordering = ('label',) class Organization(Address, OwnPerms, ValueGetter): + TABLE_COLS = ('name', 'organization_type',) name = models.CharField(_(u"Name"), max_length=100) organization_type = models.ForeignKey(OrganizationType, verbose_name=_(u"Type")) @@ -719,6 +720,13 @@ class Organization(Address, OwnPerms, ValueGetter): def __unicode__(self): return self.name + @property + def associated_filename(self): + values = [unicode(getattr(self, attr)) + for attr in ('organization_type', 'name') + if getattr(self, attr)] + return slugify(u"-".join(values)) + class PersonType(GeneralType): #rights = models.ManyToManyField(WizardStep, verbose_name=_(u"Rights")) groups = models.ManyToManyField(Group, verbose_name=_(u"Groups"), -- cgit v1.2.3