diff options
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r-- | archaeological_operations/models.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index bbffe023f..aa72d24ec 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -391,10 +391,11 @@ class ActType(GeneralType): ordering = ('label',) class AdministrativeAct(BaseHistorizedItem, OwnPerms, ValueGetter): - TABLE_COLS = ['year', 'index', 'act_type', 'signature_date', + TABLE_COLS = ['full_ref', 'act_type', 'signature_date', 'associated_file', 'operation'] - TABLE_COLS_FILE = ['act_type', 'associated_file', 'associated_file.towns',] - TABLE_COLS_OPE = ['act_type', 'operation', 'operation.towns'] + TABLE_COLS_FILE = ['full_ref', 'act_type', 'associated_file', + 'associated_file.towns',] + TABLE_COLS_OPE = ['full_ref', 'act_type', 'operation', 'operation.towns'] act_type = models.ForeignKey(ActType, verbose_name=_(u"Act type")) in_charge = models.ForeignKey(Person, blank=True, null=True, related_name='+', verbose_name=_(u"Person in charge of the operation")) @@ -442,6 +443,16 @@ class AdministrativeAct(BaseHistorizedItem, OwnPerms, ValueGetter): for item in [self.operation, self.associated_file, self.act_object] if item]) + full_ref_lbl = _(u"Ref.") + @property + def full_ref(self): + keys = ['year', 'index'] + if settings.COUNTRY == 'fr': + keys.append('ref_sra') + return settings.JOINT.join( + [getattr(self, k) and unicode(getattr(self, k)) or '-' + for k in keys]) + @property def year(self): if not self.signature_date: |