summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-04-24 17:30:07 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-04-24 17:32:01 +0200
commit2b2935ccf265216a33345c2fd953c205ce143827 (patch)
tree5a5f5b3a1bccbc4c738108d50ae396718819af20 /ishtar_common/models.py
parentf2cd1c1326d5fbfbd39a7b2a30a278dd66883c3c (diff)
downloadIshtar-2b2935ccf265216a33345c2fd953c205ce143827.tar.bz2
Ishtar-2b2935ccf265216a33345c2fd953c205ce143827.zip
Sheet area
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 1045adbe5..3e5b44d8a 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -2341,7 +2341,7 @@ class DocumentTemplate(models.Model):
return output_name
-class Area(HierarchicalType, DocumentItem):
+class Area(HierarchicalType, DocumentItem, MainItem):
SLUG = "area"
towns = models.ManyToManyField(
Town, verbose_name=_("Towns"), blank=True, related_name="areas"
@@ -2450,8 +2450,13 @@ class Area(HierarchicalType, DocumentItem):
def _get_base_image_path(self):
return self.SLUG
+ @property
+ def associated_filename(self):
+ value = self.reference if self.reference else self.name
+ return slugify(value)
+
-#m2m_changed.connect(document_attached_changed, sender=Area.documents.through)
+m2m_changed.connect(document_attached_changed, sender=Area.documents.through)
GENDER = (