mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-11-08 21:21:06 +00:00
Remove unneeded filters
This commit is contained in:
parent
8c439ab530
commit
3f6e86dae1
1 changed files with 0 additions and 18 deletions
|
@ -1065,16 +1065,6 @@ class AppointmentView(SecureAdminModelView):
|
||||||
|
|
||||||
|
|
||||||
class ExperimentMarkView(SecureAdminModelView):
|
class ExperimentMarkView(SecureAdminModelView):
|
||||||
class StudentFilter(FilterEqual):
|
|
||||||
def validate(self, value):
|
|
||||||
if db.session.get(Student, value) is not None:
|
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def apply(self, query, value, alias=None):
|
|
||||||
return query.join(PartStudent).where(PartStudent.student_id == int(value))
|
|
||||||
|
|
||||||
class AssistantFilter(AssistantRowFilter):
|
class AssistantFilter(AssistantRowFilter):
|
||||||
def apply(self, query, value, alias=None):
|
def apply(self, query, value, alias=None):
|
||||||
return query.where(ExperimentMark.assistant_id == int(value))
|
return query.where(ExperimentMark.assistant_id == int(value))
|
||||||
|
@ -1109,12 +1099,6 @@ class ExperimentMarkView(SecureAdminModelView):
|
||||||
def apply(self, query, value, alias=None):
|
def apply(self, query, value, alias=None):
|
||||||
return query.join(PartStudent).where(PartStudent.part_id == int(value))
|
return query.join(PartStudent).where(PartStudent.part_id == int(value))
|
||||||
|
|
||||||
class SemesterFilter(SemesterRowFilter):
|
|
||||||
def apply(self, query, value, alias=None):
|
|
||||||
return (
|
|
||||||
query.join(GroupExperiment).join(SemesterExperiment).where(SemesterExperiment.semester_id == int(value))
|
|
||||||
)
|
|
||||||
|
|
||||||
class CreateForm(FlaskForm):
|
class CreateForm(FlaskForm):
|
||||||
part_student = QuerySelectField(
|
part_student = QuerySelectField(
|
||||||
"Part Student",
|
"Part Student",
|
||||||
|
@ -1144,8 +1128,6 @@ class ExperimentMarkView(SecureAdminModelView):
|
||||||
}
|
}
|
||||||
|
|
||||||
column_filters = (
|
column_filters = (
|
||||||
StudentFilter(ExperimentMark, "Student / ID"),
|
|
||||||
SemesterFilter(ExperimentMark, "Semester"),
|
|
||||||
AssistantFilter(ExperimentMark, "Assistant"),
|
AssistantFilter(ExperimentMark, "Assistant"),
|
||||||
AdminFilter(ExperimentMark, "Admin"),
|
AdminFilter(ExperimentMark, "Admin"),
|
||||||
ExperimentFilter(ExperimentMark, "Experiment"),
|
ExperimentFilter(ExperimentMark, "Experiment"),
|
||||||
|
|
Loading…
Reference in a new issue