summaryrefslogtreecommitdiff
path: root/chimere/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/models.py')
-rw-r--r--chimere/models.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/chimere/models.py b/chimere/models.py
index 7b08830..f33772c 100644
--- a/chimere/models.py
+++ b/chimere/models.py
@@ -237,6 +237,24 @@ class Marker(GeographicItem):
return self.name
@property
+ def multimedia_pictures(self):
+ pict = self.pictures.filter(miniature=False)
+ if pict.count():
+ return pict.all()
+
+ @property
+ def multimedia_files(self):
+ mm = self.multimedia_files.filter()
+ if mm.count():
+ return mm.all()
+
+ @property
+ def default_picture(self):
+ pict = self.pictures.filter(miniature=True)
+ if pict.count():
+ return pict.all()[0]
+
+ @property
def date(self):
if settings.CHIMERE_DAYS_BEFORE_EVENT:
return self.start_date