summaryrefslogtreecommitdiff
path: root/ishtar_common/models_common.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models_common.py')
-rw-r--r--ishtar_common/models_common.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py
index ae4b5a64b..adc6ca9eb 100644
--- a/ishtar_common/models_common.py
+++ b/ishtar_common/models_common.py
@@ -3483,7 +3483,17 @@ class Town(GeographicItem, Imported, DocumentItem, MainItem, models.Model):
for area in self.areas.all():
label.append(" - ")
label.append(area.full_label)
- return " ".join(label)
+ label = " ".join(label)
+ if self.children.count():
+ label += str(_(", old town of ")) + " ; ".join([
+ "{label} ({code})".format(label=p.name, code=p.numero_insee)
+ if p.numero_insee else p.name for p in self.children.all()
+ ])
+ return label
+
+ @property
+ def detail_label(self):
+ return self.label_with_areas
def generate_geo(self, force=False):
force = self.generate_limit(force=force)