mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-07-08 06:50:19 +02:00
Add a modal to create a question
This commit is contained in:
@ -6,7 +6,7 @@ from django.core.exceptions import ValidationError
|
||||
from django.db.models import Q
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from .models import Participation, Phase, Team, Video
|
||||
from .models import Participation, Phase, Question, Team, Video
|
||||
|
||||
|
||||
class TeamForm(forms.ModelForm):
|
||||
@ -138,12 +138,24 @@ class SendParticipationForm(forms.ModelForm):
|
||||
self.instance = participation
|
||||
return cleaned_data
|
||||
|
||||
|
||||
class Meta:
|
||||
model = Participation
|
||||
fields = ('sent_participation',)
|
||||
|
||||
|
||||
class QuestionForm(forms.ModelForm):
|
||||
"""
|
||||
Create or update a question.
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields["question"].widget.attrs.update({"placeholder": _("How did you get the idea to ...?")})
|
||||
|
||||
class Meta:
|
||||
model = Question
|
||||
fields = ('question',)
|
||||
|
||||
|
||||
class PhaseForm(forms.ModelForm):
|
||||
"""
|
||||
Form to update the calendar of a phase.
|
||||
|
Reference in New Issue
Block a user