summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-12-29 18:26:54 +0100
committerÉtienne Loks <etienne.loks@proxience.com>2015-12-29 18:28:18 +0100
commit70d050cb7de7c5620cf5992db5a281669cfef958 (patch)
tree648da5accc2a93a9ff5c0c80dd1ddc09f6bc708f /ishtar_common/models.py
parent535d091d8b2ecacbcc9ae7d32a80596aa60ed62f (diff)
downloadIshtar-70d050cb7de7c5620cf5992db5a281669cfef958.tar.bz2
Ishtar-70d050cb7de7c5620cf5992db5a281669cfef958.zip
Add a template for operation sources
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index f720dc5ab..ec3d2e2a6 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -2153,7 +2153,7 @@ class Source(models.Model):
item_number = models.IntegerField(_(u"Item number"), default=1)
reference = models.CharField(_(u"Ref."), max_length=25, null=True,
blank=True)
- internal_reference = models.CharField(_(u"Internal reference"),
+ internal_reference = models.CharField(_(u"Internal ref."),
max_length=25, null=True, blank=True)
description = models.TextField(_(u"Description"), blank=True, null=True)
comment = models.TextField(_(u"Comment"), blank=True, null=True)
@@ -2167,6 +2167,13 @@ class Source(models.Model):
def __unicode__(self):
return self.title
+ @property
+ def associated_filename(self):
+ values = [unicode(getattr(self, attr))
+ for attr in ('source_type', 'title')
+ if getattr(self, attr)]
+ return slugify(u"-".join(values))
+
if settings.COUNTRY == 'fr':
class Arrondissement(models.Model):
name = models.CharField(u"Nom", max_length=30)