Commit affc92b1 authored by Luis García's avatar Luis García
Browse files

Update questions poll

parent 17d636a6
......@@ -27,6 +27,7 @@ class Question(models.Model):
content = models.CharField(verbose_name='Content', max_length=200)
poll = models.ForeignKey(Poll, verbose_name='Poll', on_delete=models.PROTECT, related_name='questions')
type = models.CharField(verbose_name='Type', max_length=20, choices=TYPE_CHOICES, default='x')
weighing = models.PositiveSmallIntegerField(verbose_name='Weighing', default=10)
owner = models.ForeignKey(User, verbose_name='Owner', on_delete=models.PROTECT, related_name='polls_questions')
created = models.DateTimeField(auto_now_add=True, verbose_name='Create date')
updated = models.DateTimeField(auto_now=True, verbose_name='Update date')
......
......@@ -9,7 +9,7 @@ class QuestionSerializer(ModelSerializer):
class Meta:
model = Question
fields = ('id', 'content', 'poll', 'type')
fields = ('id', 'content', 'poll', 'weighing', 'type')
ref_name = 'Poll question'
class PollSerializer(ModelSerializer):
......
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