diff options
| 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 |
| commit | e36ae6b8508a1e60f45a2edffb40e4b104e29de9 (patch) | |
| tree | 668089a9b4afc76842a42d01b978df7a09d6b907 /archaeological_finds/models_treatments.py | |
| parent | 1da20a5b5bb591c0789f570399d9c644ec3e4263 (diff) | |
| download | Ishtar-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.py | 6 |
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 |
