Commit 94f1b651 authored by Julia Anishka's avatar Julia Anishka

added reaction model

parent b9e6a7ba
...@@ -10,3 +10,15 @@ class Announcement(models.Model): ...@@ -10,3 +10,15 @@ class Announcement(models.Model):
def __str__(self): def __str__(self):
return self.title return self.title
class Reaction(models.Model):
class Choices(models.TextChoices):
like = 'Like'
love = 'Love'
angry = 'Angry'
name = models.CharField(max_length = 5, choices = Choices.choices)
tally = models.IntegerField(default = 0)
announcement = models.ForeignKey(Announcement, on_delete = models.CASCADE)
def __str__(self):
return self.name
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