From 29601ea7460e8489426d36fe734bdd81bed11bcc Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 17 Jul 2013 01:16:33 +0200 Subject: Better display of finds in sheets --- .../templates/ishtar/sheet_contextrecord.html | 11 ++++++----- archaeological_finds/models.py | 4 ++-- .../templates/ishtar/sheet_operation.html | 4 +++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html index d8e06f022..7fd004362 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html @@ -100,8 +100,9 @@ {%trans "Finds"%} {% trans "Find" %} + {% trans "Id by material type" %} {% trans "Material type" %} - {% trans "Context record" %} + {% trans "Context record" context "short"%} {% trans "Periods" %} {% trans "Description" %} {% trans "Weight" %} @@ -111,14 +112,14 @@ {% for find in item.base_finds.all %} - {{ find.full_label }} + {{ find.full_label }} {# Displayed as (Patriarche operation code)-(Record unit label)-(Finds label). #} {# or displayed as (Year)-(index)-(Record unit label)-(Finds label). #} - {{ find.material_type_label }} + {{ find.material_type_label }} {# Displayed as (Patriarche operation code)-(Record unit label)-(material code)-(Finds label indexed by material type). #} {# or displayed as (Year)-(index)-(Record unit label)-(material code)-(Finds label indexed by material type) #} - - {{find.context_record}} + {{ find.material|default:"" }} + {{find.context_record.label}} {{ find.get_last_find.dating}}{# TODO .all|join:", " ? #} {{ find.get_last_find.description }} {{ find.get_last_find.weight }} diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index 4d44e67fd..c7ed9083e 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -72,11 +72,11 @@ class BaseFind(BaseHistorizedItem, OwnPerms): return finds and finds[0] def full_label(self): - return self._real_label() or self._temp_label() + return self._real_label() or self._temp_label() or u"" def material_type_label(self): find = self.get_last_find() - finds = [find and unicode(find.material_type) or ''] + finds = [find and find.material_type.code or ''] ope = self.context_record.operation finds += [ope.code_patriarche or \ (unicode(ope.year) + "-" + unicode(ope.operation_code))] diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index 3a6a20e74..1e43c7112 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -145,8 +145,9 @@ {%trans "Finds"%} {% trans "Find" %} + {% trans "Id by material type" %} {% trans "Material type" %} - {% trans "Context record" %} + {% trans "Context record" context "short"%} {% trans "Periods" %} {% trans "Description" %} {% trans "Weight" %} @@ -161,6 +162,7 @@ {# Displayed as (Patriarche operation code)-(Record unit label)-(Finds label). #} {# or displayed as (Year)-(index)-(Record unit label)-(Finds label). #} {{ find.material_type_label }} + {{ find.material|default:"" }} {{find.context_record.label}} {{ find.get_last_find.dating}}{# TODO .all|join:", " ? #} {{ find.get_last_find.description }} -- cgit v1.2.3