diff options
Diffstat (limited to 'archaeological_operations')
| -rw-r--r-- | archaeological_operations/models.py | 14 | 
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')), | 
