diff options
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: |