diff options
| author | Étienne Loks <etienne.loks@peacefrogs.net> | 2014-01-16 20:49:57 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2014-01-16 20:50:45 +0100 | 
| commit | bcb27ee5d77a8d60e25443f9aef59c395b4cee06 (patch) | |
| tree | e5d1e4fdf72caacf457924a0b79e9506e7313011 /archaeological_operations/models.py | |
| parent | 818463cd01a5f82861058cf75e0f6e794d69f57e (diff) | |
| download | Ishtar-bcb27ee5d77a8d60e25443f9aef59c395b4cee06.tar.bz2 Ishtar-bcb27ee5d77a8d60e25443f9aef59c395b4cee06.zip  | |
Improve layout of administrativ acts in tables and record carts (refs #1621)
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:  | 
