From c76eeed045946992f6a47dacc74147123b613f90 Mon Sep 17 00:00:00 2001 From: Ernesto Rico Schmidt <ernesto@helsinki.at> Date: Wed, 3 Aug 2022 17:32:01 -0400 Subject: [PATCH] Use abstract ModelWithImageFields for Show model this renames the fields - `ppoi` -> `image_ppoi` - `width` -> `image_width` - `height` -> `image_height` and adds the fields `image_credits` and `image_alt_text`. --- program/models.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/program/models.py b/program/models.py index cb953ca0..ea31cd4d 100644 --- a/program/models.py +++ b/program/models.py @@ -203,7 +203,7 @@ class HostLink(Link): host = models.ForeignKey(Host, on_delete=models.CASCADE, related_name="links") -class Show(models.Model): +class Show(ModelWithImageFields): predecessor = models.ForeignKey( "self", blank=True, @@ -229,17 +229,6 @@ class Show(models.Model): music_focus = models.ManyToManyField(MusicFocus, blank=True, related_name="shows") name = models.CharField(max_length=255) slug = models.CharField(max_length=255, unique=True) - ppoi = PPOIField() - height = models.PositiveIntegerField(blank=True, null=True, editable=False) - width = models.PositiveIntegerField(blank=True, null=True, editable=False) - image = VersatileImageField( - blank=True, - null=True, - upload_to="show_images", - width_field="width", - height_field="height", - ppoi_field="ppoi", - ) logo = models.ImageField(blank=True, null=True, upload_to="show_images") short_description = models.TextField() description = models.TextField(blank=True, null=True) -- GitLab