1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-11-08 21:21:06 +00:00

Use selection mark field

This commit is contained in:
Mo 2022-06-27 00:20:15 +02:00
parent 80e7ff731f
commit eb09b793c6

View file

@ -2,7 +2,7 @@ from flask_wtf import FlaskForm
from wtforms.fields import DateField, SubmitField, TextAreaField from wtforms.fields import DateField, SubmitField, TextAreaField
from wtforms.validators import DataRequired, Optional from wtforms.validators import DataRequired, Optional
from .model_dependent_funs import mark_field from .model_dependent_funs import selection_mark_field
class AssistantGroupExperimentFormBase(FlaskForm): class AssistantGroupExperimentFormBase(FlaskForm):
@ -16,6 +16,7 @@ def assistant_group_experiment_form_factory(current_user, group_experiment):
default=group_experiment.note, default=group_experiment.note,
validators=[Optional()], validators=[Optional()],
description="The note is optional and can be seen and edited by admins and assistants that are responsible for this semester experiment. This note is for information related to the experiment and group. Examples: Protocol received, submission until ..., etc.", description="The note is optional and can be seen and edited by admins and assistants that are responsible for this semester experiment. This note is for information related to the experiment and group. Examples: Protocol received, submission until ..., etc.",
render_kw={"class": "form-control"},
) )
appointments = group_experiment.appointments appointments = group_experiment.appointments
@ -35,6 +36,7 @@ def assistant_group_experiment_form_factory(current_user, group_experiment):
default=appointment.date, default=appointment.date,
validators=[DataRequired()], validators=[DataRequired()],
description=description, description=description,
render_kw={"class": "form-control"},
), ),
) )
appointment_num += 1 appointment_num += 1
@ -45,12 +47,12 @@ def assistant_group_experiment_form_factory(current_user, group_experiment):
setattr( setattr(
AssistantGroupExperimentForm, AssistantGroupExperimentForm,
"oral_experiment_mark_" + str(experiment_mark_num), "oral_experiment_mark_" + str(experiment_mark_num),
mark_field("Oral", experiment_mark.oral_mark), selection_mark_field("Oral", experiment_mark.oral_mark),
) )
setattr( setattr(
AssistantGroupExperimentForm, AssistantGroupExperimentForm,
"protocol_experiment_mark_" + str(experiment_mark_num), "protocol_experiment_mark_" + str(experiment_mark_num),
mark_field("Protocol", experiment_mark.protocol_mark), selection_mark_field("Protocol", experiment_mark.protocol_mark),
) )
experiment_mark_num += 1 experiment_mark_num += 1