diff options
Diffstat (limited to 'ishtar_common')
| -rw-r--r-- | ishtar_common/models.py | 10 | ||||
| -rw-r--r-- | ishtar_common/wizards.py | 2 | 
2 files changed, 12 insertions, 0 deletions
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) diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 2182e9060..f200447e4 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -789,6 +789,8 @@ class Wizard(NamedUrlWizardView):                          for old_item in old_m2ms[key]:                              is_ok = True                              for k in value: +                                if not hasattr(old_item, k): +                                    continue                                  if is_ok and getattr(old_item, k) != value[k]:                                      is_ok = False                                      continue  | 
