diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-13 15:18:13 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-13 15:18:13 +0100 |
commit | f24383496f378392a378c99f22695c0f2a73dc2a (patch) | |
tree | 1117c82af80da844ad62b2758e812796948e2d80 | |
parent | e90c8378415c5ee394a220890a07615d1f4b011e (diff) | |
download | Ishtar-f24383496f378392a378c99f22695c0f2a73dc2a.tar.bz2 Ishtar-f24383496f378392a378c99f22695c0f2a73dc2a.zip |
Sheet operation: add INSEE code to towns (refs #3506)
-rw-r--r-- | archaeological_operations/models.py | 4 | ||||
-rw-r--r-- | archaeological_operations/templates/ishtar/sheet_operation.html | 2 |
2 files changed, 5 insertions, 1 deletions
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 %} <h3>{% trans "Localisation"%}</h3> <ul class='form-flex'> -{% field_li_multiple "Towns" item.towns %} +{% field_li "Towns" item.towns_codes|join:" ; " %} {% field_li "Main address" item.associated_file.address %} {% field_li "Complement" item.associated_file.address_complement %} {% field_li "Postal code" item.associated_file.postal_code %} |