From c641fca2bc2bd5c6892b4105325dee99e9da35d6 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 18 May 2022 16:24:26 +0200 Subject: Syndication - serialization - display sheet find - 2 --- ishtar_common/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ishtar_common/models.py') 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( @@ -4324,6 +4324,10 @@ class Document( image="" ) + @property + def images_number(self): + return self.images.count() + @property def main_image(self): if self.images.count(): -- cgit v1.2.3