summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2011-03-16 15:51:08 +0100
committerÉtienne Loks <etienne.loks@peacefrogs.net>2011-03-16 15:51:33 +0100
commit0dd39cd1f2bbc30554fdc68b852c3f58a1ca5027 (patch)
treeec8dd7f6ab6473a458cd358899f67bdbd3f60b16
parent6993b5c980a78e8a7aa06cac3003aa8d2bf7a1e3 (diff)
downloadIshtar-0dd39cd1f2bbc30554fdc68b852c3f58a1ca5027.tar.bz2
Ishtar-0dd39cd1f2bbc30554fdc68b852c3f58a1ca5027.zip
Correct the operation sheet (closes #275)
-rw-r--r--ishtar/furnitures/models.py5
-rw-r--r--ishtar/templates/sheet_operation.html8
2 files changed, 8 insertions, 5 deletions
diff --git a/ishtar/furnitures/models.py b/ishtar/furnitures/models.py
index e93b74612..2aa78cf23 100644
--- a/ishtar/furnitures/models.py
+++ b/ishtar/furnitures/models.py
@@ -550,6 +550,9 @@ class Dating(models.Model):
verbose_name = _(u"Dating")
verbose_name_plural = _(u"Datings")
+ def __unicode__(self):
+ return u"%s (%d-%d)" % (self.period, self.start_date, self.end_date)
+
class Unit(GeneralType) :
order = models.IntegerField(_(u"Order"))
parent = models.ForeignKey("Unit", verbose_name=_(u"Parent unit"),
@@ -566,7 +569,7 @@ class ContextRecord(BaseHistorizedItem, OwnPerms):
TABLE_COLS = ['parcel.town', 'parcel.section', 'parcel.parcel_number',
'label',]
parcel = models.ForeignKey(Parcel, verbose_name=_(u"Parcel"),
- related_name='context_records')
+ related_name='context_record')
label = models.CharField(_(u"Label"), max_length=200)
description = models.TextField(_("Description"), blank=True, null=True)
lenght = models.IntegerField(_(u"Lenght"))
diff --git a/ishtar/templates/sheet_operation.html b/ishtar/templates/sheet_operation.html
index d0e31ae5a..10fa8ad61 100644
--- a/ishtar/templates/sheet_operation.html
+++ b/ishtar/templates/sheet_operation.html
@@ -108,20 +108,20 @@
<th class='link'>&nbsp;</th>
</tr>
{% for parcel in item.parcels.all %}
- {% for context_record in item.context_record.all %}
+ {% for context_record in parcel.context_record.all %}
<tr>
<td>{{ context_record.label }}</td>
<td class='string'>{{context_record.unit}}</td>
<td>{{ context_record.datings.all|join:", " }}</td>{# periods ?#}
<td class='string'>{{ context_record.description }}</td>
<td>{{ parcel.section }} - {{parcel.parcel_number}}</td>
- <td class='link'><a href="#" onclick='load_window("{%url show-context_record context_record.pk%}")'>{% trans "Details" %}</a></td>
+ <td class='link'><a href="#" {#onclick='load_window("{%url show-context_record context_record.pk%}")'#}>{% trans "Details" %}</a></td>
</tr>
{% empty %}
- <tr><td colspan="5" class='no_items'>{% trans "No context record associated to parcel " %}{{ parcel.section }} - {{parcel.parcel_number}}</td></tr>
+ <tr><td colspan="6" class='no_items'>{% trans "No context record associated to parcel " %}{{ parcel.section }} - {{parcel.parcel_number}}</td></tr>
{% endfor %}
{% empty %}
- <tr><td colspan="5" class='no_items'>{% trans "No context record associated to this operation" %}</td></tr>
+ <tr><td colspan="6" class='no_items'>{% trans "No context record associated to this operation" %}</td></tr>
{% endfor %}
</table>