1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-12-20 23:41:20 +00:00

Add a minimum to number fields

This commit is contained in:
Mo 2022-04-04 19:08:19 +02:00
parent cc3f230a3a
commit cecaf207f2

View file

@ -363,6 +363,9 @@ class PartView(SecureAdminModelView):
"Program", query_factory=programQueryFactory, validators=[DataRequired()], allow_blank=True, blank_text="-"
)
}
form_args = {
"number": {"widget": NumberInput(min=1)},
}
column_searchable_list = ["program.label", "number"]
@ -408,6 +411,7 @@ class StudentView(SecureAdminModelView):
]
form_args = {
"student_number": {"widget": NumberInput(min=0)},
"uni_email": {"validators": [Email()]},
"contact_email": {"validators": [Email()]},
}
@ -659,7 +663,9 @@ class ExperimentView(SecureAdminModelView):
]
form_args = {
"number": {"widget": NumberInput(min=1)},
"wiki_link": {"validators": [URL()]},
"duration_in_days": {"widget": NumberInput(min=1)},
}
form_extra_fields = {
"program": QuerySelectField(