diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-05-18 16:24:26 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:20:59 +0100 |
commit | c641fca2bc2bd5c6892b4105325dee99e9da35d6 (patch) | |
tree | 5f9012ed94ce2f854d9a349f7264447419cd99d3 /ishtar_common/models.py | |
parent | e39f05ef095d9b74853fa177d8ce2a566478dae2 (diff) | |
download | Ishtar-c641fca2bc2bd5c6892b4105325dee99e9da35d6.tar.bz2 Ishtar-c641fca2bc2bd5c6892b4105325dee99e9da35d6.zip |
Syndication - serialization - display sheet find - 2
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 6 |
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] |