diff options
| author | Étienne Loks <etienne.loks@proxience.com> | 2015-11-17 23:03:12 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@proxience.com> | 2015-11-17 23:03:12 +0100 | 
| commit | 01392cf2498bbfbc242759174ce201b3b5cd48bc (patch) | |
| tree | 28a66dac4ad2fce7269d347f47d23888612a029d | |
| parent | 6e762f13c2d6c9c760d0d8667d7b51160e5cfcbd (diff) | |
| download | Ishtar-01392cf2498bbfbc242759174ce201b3b5cd48bc.tar.bz2 Ishtar-01392cf2498bbfbc242759174ce201b3b5cd48bc.zip | |
Archaeological finds: add columns to full export
| -rw-r--r-- | archaeological_finds/models.py | 21 | ||||
| -rw-r--r-- | archaeological_finds/templates/ishtar/sheet_find.html | 2 | 
2 files changed, 19 insertions, 4 deletions
| diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index 80b2b9074..d4ee70c23 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -154,7 +154,7 @@ class BaseFind(BaseHistorizedItem, OwnPerms):          if not self.context_record.operation:              return          ope = self.context_record.operation -        c_id = [unicode(ope.code_patriarche) or +        c_id = [(ope.code_patriarche and unicode(ope.code_patriarche)) or                  (unicode(ope.year) + "-" + unicode(ope.operation_code))]          c_id.append(unicode(self.index))          return settings.JOINT.join(c_id) @@ -250,9 +250,22 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):      TABLE_COLS_FOR_OPE_LBL = {          'code_patriarche__index': _("Short Id"),          'code_patriarche__code__label__index': _("Complete ID")} -    EXTRA_FULL_FIELDS = ['base_finds.short_id', 'base_finds.complete_id'] -    EXTRA_FULL_FIELDS_LABELS = {'base_finds.short_id': _(u"Short Id"), -                                'base_finds.complete_id': _("Complete ID")} +    EXTRA_FULL_FIELDS = [ +        'base_finds.short_id', 'base_finds.complete_id', +        'base_finds.comment', 'base_finds.description', +        'base_finds.topographic_localisation', +        'base_finds.special_interest', +        'base_finds.discovery_date'] +    EXTRA_FULL_FIELDS_LABELS = { +        'base_finds.short_id': _(u"Base find - Short Id"), +        'base_finds.complete_id': _(u"Base find - Complete ID"), +        'base_finds.comment': _(u"Base find - Comment"), +        'base_finds.description': _(u"Base find - Description"), +        'base_finds.topographic_localisation': _(u"Base find - " +                                                 u"Topographic localisation"), +        'base_finds.special_interest': _(u"Base find - Special interest"), +        'base_finds.discovery_date': _(u"Base find - Discovery date"), +    }      base_finds = models.ManyToManyField(BaseFind, verbose_name=_(u"Base find"),                                          related_name='find')      external_id = models.CharField(_(u"External ID"), blank=True, null=True, diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index b0eaecd76..96f190120 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -64,6 +64,8 @@  <p><label>{%trans "Complete ID"%}{% trans ":"%}</label>  <span class='value'>{{base_find.complete_id}}</span></p> +{% field "Short ID" base_find.short_id %} +  {% if base_find.discovery_date %}  <p><label>{%trans "Discovery date"%}{% trans ":"%}</label>  <span class='value'>{{base_find.discovery_date}}</span></p> | 
