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
commita296bd385e704b1e76a774341f8ad126c892ccab (patch)
tree648da5accc2a93a9ff5c0c80dd1ddc09f6bc708f /ishtar_common/models.py
parent80726189acaa2ce5fa604dd589aad7d01c099d4f (diff)
downloadIshtar-a296bd385e704b1e76a774341f8ad126c892ccab.tar.bz2
Ishtar-a296bd385e704b1e76a774341f8ad126c892ccab.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)