summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_treatments.py
diff options
context:
space:
mode:
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