summaryrefslogtreecommitdiff
path: root/archaeological_operations/models.py
diff options
context:
space:
mode:
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
commitcc0f377471c838076b8f28f113ba8ddf6ba4740f (patch)
tree811c188df7e29a2f7cc0f622aec9cc86713549df /archaeological_operations/models.py
parente1d47df4a1f5a3c1106f70b1e509c877f8e6ebd8 (diff)
downloadIshtar-cc0f377471c838076b8f28f113ba8ddf6ba4740f.tar.bz2
Ishtar-cc0f377471c838076b8f28f113ba8ddf6ba4740f.zip
Shorten the label of files in operation list (refs #408)
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r--archaeological_operations/models.py10
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: