From 49ba5d9f6ccc0b0d89dd77a4d0fd6ff4ea9345f2 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 13 Mar 2017 15:18:13 +0100 Subject: Sheet operation: add INSEE code to towns (refs #3506) --- archaeological_operations/models.py | 4 ++++ archaeological_operations/templates/ishtar/sheet_operation.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index ebe9ae551..57338f81c 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -421,6 +421,10 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms, def show_url(self): return reverse('show-operation', args=[self.pk, '']) + def towns_codes(self): + return [u"{} ({})".format(town.name, town.numero_insee) for town in + self.towns.all()] + def has_finds(self): from archaeological_finds.models import BaseFind return BaseFind.objects.filter(context_record__operation=self).count() diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index f35954488..69e6c3ddf 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -72,7 +72,7 @@ {% if item.towns.count %}

{% trans "Localisation"%}