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 | ddd5ad887467e6e8592471f19997c85aafe08773 (patch) | |
tree | 668089a9b4afc76842a42d01b978df7a09d6b907 /archaeological_operations/models.py | |
parent | e401941a57c84157a6cec7a6cd37e107fb147377 (diff) | |
download | Ishtar-ddd5ad887467e6e8592471f19997c85aafe08773.tar.bz2 Ishtar-ddd5ad887467e6e8592471f19997c85aafe08773.zip |
Treatments: fix associated filename - add modify links in sheets
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r-- | archaeological_operations/models.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 307d02e97..7507da817 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -1037,7 +1037,7 @@ class AdministrativeAct(BaseHistorizedItem, OwnPerms, ValueGetter): def __unicode__(self): return settings.JOINT.join( [unicode(item) for item in [ - self.operation, self.associated_file, self.act_object] + self.related_item, self.act_object] if item]) full_ref_lbl = _(u"Ref.") @@ -1054,6 +1054,10 @@ class AdministrativeAct(BaseHistorizedItem, OwnPerms, ValueGetter): return u" ".join(lbl) @property + def associated_filename(self): + return self.get_filename() + + @property def towns(self): if self.associated_file: return self.associated_file.towns.all() @@ -1081,7 +1085,14 @@ class AdministrativeAct(BaseHistorizedItem, OwnPerms, ValueGetter): @property def related_item(self): - return self.operation if self.operation else self.associated_file + if self.operation: + return self.operation + if self.associated_file: + return self.associated_file + if self.treatment: + return self.treatment + if self.treatment_file: + return self.treatment_file def get_filename(self): filename = self.related_item.associated_filename |