Modif de navbar et du modele vote
This commit is contained in:
parent
2d50a85caa
commit
6c04ce0fea
2 changed files with 8 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
||||||
<nav class="navbar navbar-default inverted">
|
<nav class="navbar navbar-default navbar-inverse">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<!-- Brand and toggle get grouped for better mobile display -->
|
<!-- Brand and toggle get grouped for better mobile display -->
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
|
|
|
@ -4,18 +4,19 @@ from content.models import Content
|
||||||
from django.contrib.auth.models import Group, User
|
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):
|
class Vote(models.Model):
|
||||||
votant = models.ForeignKey(User, on_delete=models.CASCADE)
|
votant = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||||
content = models.ForeignKey(Content, on_delete=models.CASCADE)
|
content = models.ForeignKey(Content, on_delete=models.CASCADE)
|
||||||
|
poll = models.ForeignKey(Poll, on_delete=models.CASCADE)
|
||||||
vote = models.IntegerField(
|
vote = models.IntegerField(
|
||||||
validators=[
|
validators=[
|
||||||
validators.MaxValueValidator(5),
|
validators.MaxValueValidator(5),
|
||||||
validators.MinValueValidator(0)
|
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)
|
|
||||||
|
|
Loading…
Reference in a new issue