diff --git a/program/models.py b/program/models.py index ea31cd4d8069f26b60e94001c24bba98d152aaec..147e076c5f4aabfbedf16a31a723af3232ef7342 100644 --- a/program/models.py +++ b/program/models.py @@ -1158,7 +1158,7 @@ class TimeSlot(models.Model): return str("".join(s for s in string if s.isdigit())) -class Note(models.Model): +class Note(ModelWithImageFields): timeslot = models.OneToOneField(TimeSlot, on_delete=models.CASCADE, unique=True) contributors = models.ManyToManyField(Host, related_name="contributions") owner = models.ForeignKey( @@ -1168,17 +1168,6 @@ class Note(models.Model): slug = models.SlugField(max_length=32, unique=True) summary = models.TextField(blank=True) content = models.TextField() - 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="note_images", - width_field="width", - height_field="height", - ppoi_field="ppoi", - ) cba_id = models.IntegerField(blank=True, null=True) tags = models.TextField(blank=True, null=True) @@ -1195,11 +1184,6 @@ class Note(models.Model): super(Note, self).save(*args, **kwargs) - # Generate thumbnails - if self.image.name and THUMBNAIL_SIZES: - for size in THUMBNAIL_SIZES: - self.image.thumbnail = self.image.crop[size].name - class NoteLink(Link): note = models.ForeignKey(Note, on_delete=models.CASCADE, related_name="links")