mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-29 18:03:51 +00:00
Further deduplication
This commit is contained in:
parent
2790652475
commit
4c64a8cefd
1 changed files with 10 additions and 10 deletions
|
@ -1135,6 +1135,14 @@ class AppointmentView(SecureAdminModelView):
|
|||
)
|
||||
|
||||
|
||||
def mark_field(mark_type: str):
|
||||
return IntegerField(
|
||||
mark_type + " Mark",
|
||||
validators=[Optional(), NumberRange(MIN_MARK, MAX_MARK)],
|
||||
description=f"Between {MIN_MARK} and {MAX_MARK}.",
|
||||
)
|
||||
|
||||
|
||||
class ExperimentMarkView(SecureAdminModelView):
|
||||
class StudentFilter(FilterEqual):
|
||||
def validate(self, value):
|
||||
|
@ -1215,16 +1223,8 @@ class ExperimentMarkView(SecureAdminModelView):
|
|||
)
|
||||
|
||||
class EditForm(Form):
|
||||
oral_mark = IntegerField(
|
||||
"Oral Mark",
|
||||
validators=[Optional(), NumberRange(MIN_MARK, MAX_MARK)],
|
||||
description=f"Between {MIN_MARK} and {MAX_MARK}.",
|
||||
)
|
||||
protocol_mark = IntegerField(
|
||||
"Protocol Mark",
|
||||
validators=[Optional(), NumberRange(MIN_MARK, MAX_MARK)],
|
||||
description=f"Between {MIN_MARK} and {MAX_MARK}.",
|
||||
)
|
||||
oral_mark = mark_field("Oral")
|
||||
protocol_mark = mark_field("Protocol")
|
||||
|
||||
column_descriptions = {
|
||||
"oral_mark": f"Between {MIN_MARK} and {MAX_MARK}",
|
||||
|
|
Loading…
Reference in a new issue