From c4d2323e9567dc19b08fedea58298408f75894d5 Mon Sep 17 00:00:00 2001 From: Ernesto Rico Schmidt <ernesto@helsinki.at> Date: Mon, 3 Apr 2023 19:03:54 -0400 Subject: [PATCH] Remove ModelWithImageFields --- program/models.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/program/models.py b/program/models.py index cebf9321..a089ab54 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` -- GitLab