From 720f1c11935732508450fb93c7599d9c4da7f30a Mon Sep 17 00:00:00 2001 From: Mo8it Date: Mon, 30 May 2022 04:29:02 +0200 Subject: [PATCH] Add search to AssistantExperimentMarkView --- advlabdb/adminModelViews.py | 5 ++++- advlabdb/assistantModelViews.py | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/advlabdb/adminModelViews.py b/advlabdb/adminModelViews.py index 977a930..ad5c233 100644 --- a/advlabdb/adminModelViews.py +++ b/advlabdb/adminModelViews.py @@ -375,7 +375,10 @@ class PartView(SecureAdminModelView): "number": {"widget": NumberInput(min=1)}, } - column_searchable_list = ["program.label", "number"] + column_searchable_list = [ + "program.label", + "number", + ] def query_modifier(self, query): return query.where(Part.semester == current_user.active_semester) diff --git a/advlabdb/assistantModelViews.py b/advlabdb/assistantModelViews.py index 6dfcf56..2bc1fcf 100644 --- a/advlabdb/assistantModelViews.py +++ b/advlabdb/assistantModelViews.py @@ -92,6 +92,13 @@ class AssistantExperimentMarkView(SecureAssistantModelView): "admin": "The last admin who edited the mark", } + column_searchable_list = [ + "part_student.student.first_name", + "part_student.student.last_name", + "part_student.student.uni_email", + "part_student.student.contact_email", + ] + column_editable_list = [ "oral_mark", "protocol_mark",