summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
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
commitd79eb0d477b78037e6f94209a091293c92a424ab (patch)
tree28a66dac4ad2fce7269d347f47d23888612a029d /archaeological_finds
parentc085fb4744d04ea7956a62b9151f62a8008da1d2 (diff)
downloadIshtar-d79eb0d477b78037e6f94209a091293c92a424ab.tar.bz2
Ishtar-d79eb0d477b78037e6f94209a091293c92a424ab.zip
Archaeological finds: add columns to full export
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/models.py21
-rw-r--r--archaeological_finds/templates/ishtar/sheet_find.html2
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>