From ec70d966ac047d1efd6b0a39de69ddc052942d72 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Sat, 21 May 2022 21:19:26 +0200 Subject: [PATCH] Replace self.column --- advlabdb/adminModelViews.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/advlabdb/adminModelViews.py b/advlabdb/adminModelViews.py index 72698c7..39dea62 100644 --- a/advlabdb/adminModelViews.py +++ b/advlabdb/adminModelViews.py @@ -85,7 +85,7 @@ class SemesterRowFilter(FilterEqual): class UserView(SecureAdminModelView): class SemesterFilter(SemesterRowFilter): def apply(self, query, value, alias=None): - return query.where(self.column.active_semester_id == int(value)) + return query.where(User.active_semester_id == int(value)) class CreateForm(Form): def roleQueryFactory(): @@ -481,7 +481,7 @@ class PartRowFilter(FilterEqual): class PartStudentView(SecureAdminModelView): class PartFilter(PartRowFilter): def apply(self, query, value, alias=None): - return query.where(self.column.part_id == int(value)) + return query.where(PartStudent.part_id == int(value)) class StudentEndpointLinkRowAction(CustomIdEndpointLinkRowAction): def customId(self, row): @@ -583,7 +583,7 @@ class ProgramRowFilter(FilterEqual): class GroupView(SecureAdminModelView): class ProgramFilter(ProgramRowFilter): def apply(self, query, value, alias=None): - return query.where(self.column.program_id == int(value)) + return query.where(Group.program_id == int(value)) def formFactory(is_created, group): if is_created: @@ -645,7 +645,7 @@ class GroupView(SecureAdminModelView): class ExperimentView(SecureAdminModelView): class ProgramFilter(ProgramRowFilter): def apply(self, query, value, alias=None): - return query.where(self.column.program_id == int(value)) + return query.where(Experiment.program_id == int(value)) can_view_details = True @@ -1099,7 +1099,7 @@ class AppointmentView(SecureAdminModelView): class AssistantFilter(AssistantRowFilter): def apply(self, query, value, alias=None): - return query.where(self.column.assistant_id == int(value)) + return query.where(Appointment.assistant_id == int(value)) class GroupExperimentEndpointLinkRowAction(CustomIdEndpointLinkRowAction): def customId(self, row): @@ -1204,7 +1204,7 @@ class ExperimentMarkView(SecureAdminModelView): class AssistantFilter(AssistantRowFilter): def apply(self, query, value, alias=None): - return query.where(self.column.assistant_id == int(value)) + return query.where(ExperimentMark.assistant_id == int(value)) class AdminFilter(FilterEqual): def get_options(self, view): @@ -1215,7 +1215,7 @@ class ExperimentMarkView(SecureAdminModelView): return tuple((admin.id, admin.repr()) for admin in admins) def apply(self, query, value, alias=None): - return query.where(self.column.admin_id == int(value)) + return query.where(ExperimentMark.admin_id == int(value)) class ExperimentFilter(ExperimentRowFilter): def apply(self, query, value, alias=None):