diff --git a/templates/nav_bar.html b/templates/nav_bar.html index 6702bdf..8a52b38 100644 --- a/templates/nav_bar.html +++ b/templates/nav_bar.html @@ -1,4 +1,4 @@ - + diff --git a/vote/models.py b/vote/models.py index ec93860..c92be4c 100644 --- a/vote/models.py +++ b/vote/models.py @@ -4,18 +4,19 @@ from content.models import Content from django.contrib.auth.models import Group, User +class Poll(models.Model): + voters_group = models.ForeignKey(Group, on_delete=models.CASCADE) + contents = models.ManyToManyField(Content) + title = models.CharField(max_length=1024) + + class Vote(models.Model): votant = models.ForeignKey(User, on_delete=models.CASCADE) content = models.ForeignKey(Content, on_delete=models.CASCADE) + poll = models.ForeignKey(Poll, on_delete=models.CASCADE) vote = models.IntegerField( validators=[ validators.MaxValueValidator(5), validators.MinValueValidator(0) ] ) - - -class Poll(models.Model): - voters_group = models.ForeignKey(Group, on_delete=models.CASCADE) - contents = models.ManyToManyField(Content) - title = models.CharField(max_length=1024)