1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-21 03:58:23 +02:00

Add Question model

This commit is contained in:
Yohann D'ANELLO
2020-10-31 14:37:36 +01:00
parent c11a40e054
commit 2a282e366e
3 changed files with 51 additions and 9 deletions

View File

@ -0,0 +1,22 @@
# Generated by Django 3.0.10 on 2020-10-31 13:36
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('participation', '0006_phase'),
]
operations = [
migrations.CreateModel(
name='Question',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('question', models.TextField(verbose_name='question')),
('participation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='questions', to='participation.Participation', verbose_name='participation')),
],
),
]

View File

@ -230,6 +230,22 @@ class Video(models.Model):
verbose_name_plural = _("videos")
class Question(models.Model):
"""
Question to ask to the team that sent a solution.
"""
participation = models.ForeignKey(
Participation,
on_delete=models.CASCADE,
verbose_name=_("participation"),
related_name="questions",
)
question = models.TextField(
verbose_name=_("question"),
)
class Phase(models.Model):
"""
The Phase model corresponds to the dates of the phase.