summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-03-14 17:24:24 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-03-14 17:24:24 +0100
commite9e03493f014a9374838d4a57ce8b995c753b6b6 (patch)
tree0be4210384aa3eff454e128cffaeb3c185b99149
parent0507c84856700376e06ae03b93366a7be3063771 (diff)
downloadIshtar-e9e03493f014a9374838d4a57ce8b995c753b6b6.tar.bz2
Ishtar-e9e03493f014a9374838d4a57ce8b995c753b6b6.zip
Operation sources: change headers
-rw-r--r--archaeological_operations/models.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index 06a5fc0ff..bb1f2a256 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -852,8 +852,8 @@ class OperationByDepartment(models.Model):
class OperationSource(Source):
SHOW_URL = 'show-operationsource'
MODIFY_URL = 'operation_source_modify'
- TABLE_COLS = ['operation.year', 'operation.operation_code', 'index'] + \
- Source.TABLE_COLS
+ TABLE_COLS = ['operation__code_patriarche', 'operation__year',
+ 'operation__operation_code', 'code'] + Source.TABLE_COLS
# search parameters
BOOL_FIELDS = ['duplicate']
@@ -868,6 +868,11 @@ class OperationSource(Source):
'operation__code_patriarche': 'operation__code_patriarche',
'operation__operation_type': 'operation__operation_type__pk',
'operation__year': 'operation__year'}
+ COL_LABELS = {
+ 'operation__year': _(u"Operation year"),
+ 'operation__operation_code': _(u"Operation code"),
+ 'code': _(u"Document code")
+ }
# fields
operation = models.ForeignKey(Operation, verbose_name=_(u"Operation"),
@@ -895,6 +900,11 @@ class OperationSource(Source):
def owner(self):
return self.operation
+ @property
+ def code(self):
+ return u"{}-{:04d}".format(self.operation.code_patriarche or '',
+ self.index)
+
class ActType(GeneralType):
TYPE = (('F', _(u'Archaeological file')),