Commit ce0cf129 authored by Ciella Francisco's avatar Ciella Francisco 😵

Edited Promo model to accommodate changes for forms.py formset

parent 8c875a66
...@@ -30,8 +30,18 @@ class Event(models.Model): ...@@ -30,8 +30,18 @@ class Event(models.Model):
# super(Event, self).save(*args, **kwargs) # super(Event, self).save(*args, **kwargs)
class Promo(models.Model): class Promo(models.Model):
img = models.ImageField(upload_to='images/', height_field=None, width_field=None, max_length=100, blank=True) event = models.ForeignKey(
event_name = models.ForeignKey(Event, on_delete=models.CASCADE) Event,
related_name="promos",
on_delete=models.CASCADE,
null=True)
img = ResizedImageField(quality=75, force_format='WebP', upload_to='promos/')
def __str__(self):
return self.event.event_name
def get_absolute_url(self):
return reverse('event_management:event-details', kwargs={'pk': self.pk})
class Comment(models.Model): class Comment(models.Model):
event_comment = models.TextField(default='', max_length=255) event_comment = models.TextField(default='', max_length=255)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment