mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-11-08 21:21:06 +00:00
Add a minimum to number fields
This commit is contained in:
parent
cc3f230a3a
commit
cecaf207f2
1 changed files with 6 additions and 0 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue