diff --git a/program/models.py b/program/models.py index cebf9321a1703ce133a6f2417abe2c5317aedb28..a089ab54d148d2078234037475655cc6dba3081a 100644 --- a/program/models.py +++ b/program/models.py @@ -46,41 +46,6 @@ class ScheduleConflictError(ValidationError): self.conflicts = conflicts -class ModelWithImageFields(models.Model): - """Abstract model that adds: - - `image`, a `VersatileImageField` - - `image_ppoi`, a `PPOIField` - - `image_width`, a `PositiveIntegerField` - - `image_height`, a `PositiveIntegerField` - - `image_credits`, a `TextField` - - `image_alt_text`, a `TextField` - """ - - image = VersatileImageField( - blank=True, - null=True, - upload_to="images", - width_field="image_width", - height_field="image_height", - ppoi_field="image_ppoi", - ) - image_ppoi = PPOIField() - image_width = models.PositiveIntegerField(blank=True, null=True, editable=False) - image_height = models.PositiveIntegerField(blank=True, null=True, editable=False) - image_credits = models.TextField(blank=True, null=True) - image_alt_text = models.TextField(blank=True, null=True) - - class Meta: - abstract = True - - def save(self, *args, **kwargs): - super().save(*args, **kwargs) - - if self.image.name and THUMBNAIL_SIZES: - for size in THUMBNAIL_SIZES: - self.image.thumbnail = self.image.crop[size].name - - class ModelWithCreatedUpdatedFields(models.Model): """Abstract model that adds: - `created_at`, a `DateTimeField` with `auto_now_add=True`