summaryrefslogtreecommitdiff
path: root/archaeological_operations/models.py
diff options
context:
space:
mode:
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
commit49ba5d9f6ccc0b0d89dd77a4d0fd6ff4ea9345f2 (patch)
tree1117c82af80da844ad62b2758e812796948e2d80 /archaeological_operations/models.py
parentba73415e947909b8e3bf8188c06cf59432dd9225 (diff)
downloadIshtar-49ba5d9f6ccc0b0d89dd77a4d0fd6ff4ea9345f2.tar.bz2
Ishtar-49ba5d9f6ccc0b0d89dd77a4d0fd6ff4ea9345f2.zip
Sheet operation: add INSEE code to towns (refs #3506)
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r--archaeological_operations/models.py4
1 files changed, 4 insertions, 0 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()