diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-08-26 20:07:49 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-08-26 20:07:49 +0200 |
commit | 54b86803f7a9e2c1013669d72212238cd74debe7 (patch) | |
tree | 811c188df7e29a2f7cc0f622aec9cc86713549df /archaeological_operations/models.py | |
parent | c07a65eab011f364f2cf24e49787b152385979c9 (diff) | |
download | Ishtar-54b86803f7a9e2c1013669d72212238cd74debe7.tar.bz2 Ishtar-54b86803f7a9e2c1013669d72212238cd74debe7.zip |
Shorten the label of files in operation list (refs #408)
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r-- | archaeological_operations/models.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 83f4f47c6..589d8d69e 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -73,7 +73,8 @@ class Period(GeneralType) : class Operation(BaseHistorizedItem, OwnPerms): TABLE_COLS = ['year_index', 'operation_type', 'remains', 'towns', - 'associated_file', 'start_date', 'excavation_end_date'] + 'associated_file_short_label', 'start_date', + 'excavation_end_date'] start_date = models.DateField(_(u"Start date"), null=True, blank=True) excavation_end_date = models.DateField(_(u"Excavation end date"), null=True, blank=True) @@ -183,6 +184,13 @@ class Operation(BaseHistorizedItem, OwnPerms): def grouped_parcels(self): return Parcel.grouped_parcels(list(self.parcels.all())) + associated_file_short_label_lbl = _(u"Archaelogical file") + @property + def associated_file_short_label(self): + if not self.associated_file: + return "" + return self.associated_file.short_label + @classmethod def get_available_operation_code(cls, year=None): if not year: |