From 3f14d0f6481f1781d598d29b79a96fb7ee727320 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 9 May 2018 17:49:16 +0200 Subject: Standardize related field item for imagee collections (refs #4076) --- ishtar_common/models.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 35be3ffc0..d4d6d2c79 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3065,6 +3065,16 @@ class IshtarImage(ImageModel): ordering = ('name',) +class ThroughImage(models.Model): + image = models.ForeignKey( + IshtarImage, on_delete=models.CASCADE) + is_main = models.BooleanField(_(u"Main image"), default=False) + + class Meta: + ordering = ('-is_main', 'image__name') + abstract = True + + if settings.COUNTRY == 'fr': class Arrondissement(models.Model): name = models.CharField(u"Nom", max_length=30) -- cgit v1.2.3