summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index e72fd2a22..c1a53213f 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -3923,7 +3923,7 @@ class Document(
),
]
SERIALIZATION_FILES = ["image", "thumbnail", "associated_file"]
- SERIALIZE_PROPERTIES = ["external_id"]
+ SERIALIZE_PROPERTIES = ["external_id", "images_number"]
title = models.TextField(_("Title"), blank=True, default="")
associated_file = models.FileField(
@@ -4325,6 +4325,10 @@ class Document(
)
@property
+ def images_number(self):
+ return self.images.count()
+
+ @property
def main_image(self):
if self.images.count():
return self.images.all()[0]