summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_treatments.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-12-13 11:12:16 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-12-13 11:12:16 +0100
commite36ae6b8508a1e60f45a2edffb40e4b104e29de9 (patch)
tree668089a9b4afc76842a42d01b978df7a09d6b907 /archaeological_finds/models_treatments.py
parent1da20a5b5bb591c0789f570399d9c644ec3e4263 (diff)
downloadIshtar-e36ae6b8508a1e60f45a2edffb40e4b104e29de9.tar.bz2
Ishtar-e36ae6b8508a1e60f45a2edffb40e4b104e29de9.zip
Treatments: fix associated filename - add modify links in sheets
Diffstat (limited to 'archaeological_finds/models_treatments.py')
-rw-r--r--archaeological_finds/models_treatments.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py
index e0fb8683c..ec1ebf7a2 100644
--- a/archaeological_finds/models_treatments.py
+++ b/archaeological_finds/models_treatments.py
@@ -414,6 +414,12 @@ class TreatmentFile(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter):
def __unicode__(self):
return self.cached_label
+ @property
+ def associated_filename(self):
+ return "-".join([str(slugify(getattr(self, attr)))
+ for attr in ('year', 'index', 'internal_reference',
+ 'name') if getattr(self, attr)])
+
def _generate_cached_label(self):
items = [unicode(getattr(self, k))
for k in ['year', 'index', 'internal_reference', 'name'] if