mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-20 23:41:20 +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 ExperimentMarkView(SecureAdminModelView):
|
||||||
class StudentFilter(FilterEqual):
|
class StudentFilter(FilterEqual):
|
||||||
def validate(self, value):
|
def validate(self, value):
|
||||||
|
@ -1215,16 +1223,8 @@ class ExperimentMarkView(SecureAdminModelView):
|
||||||
)
|
)
|
||||||
|
|
||||||
class EditForm(Form):
|
class EditForm(Form):
|
||||||
oral_mark = IntegerField(
|
oral_mark = mark_field("Oral")
|
||||||
"Oral Mark",
|
protocol_mark = mark_field("Protocol")
|
||||||
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}.",
|
|
||||||
)
|
|
||||||
|
|
||||||
column_descriptions = {
|
column_descriptions = {
|
||||||
"oral_mark": f"Between {MIN_MARK} and {MAX_MARK}",
|
"oral_mark": f"Between {MIN_MARK} and {MAX_MARK}",
|
||||||
|
|
Loading…
Reference in a new issue