Commit c424c56f authored by Agu Syquia's avatar Agu Syquia

Updated models.py

Fixed the Reaction class
parent 1ce7c109
...@@ -11,13 +11,8 @@ class Announcement(models.Model): ...@@ -11,13 +11,8 @@ class Announcement(models.Model):
return self.title return self.title
class Reaction(models.Model): class Reaction(models.Model):
reaction_choices = [ name = models.CharField(max_length=100)
('Like', 'Like'), tally = models.IntegerField(default=0)
('Love', 'Love'),
('Angry', 'Angry'),
]
name = models.CharField(max_length=100, choices=reaction_choices)
tally = models.IntegerField(default=1)
announcement = models.ForeignKey(Announcement, on_delete=models.CASCADE) announcement = models.ForeignKey(Announcement, on_delete=models.CASCADE)
def __str__(self): def __str__(self):
......
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