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_operations/models.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_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  | 
