From 189998c7d33f7ba34ea64b3eefe5f1225a4f8bd3 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Thu, 29 Jul 2021 23:37:18 +0200 Subject: [PATCH] Removed default for program in ExperimentView --- advlabdb/modelViews.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/advlabdb/modelViews.py b/advlabdb/modelViews.py index 662bdc3..522e12c 100644 --- a/advlabdb/modelViews.py +++ b/advlabdb/modelViews.py @@ -359,6 +359,9 @@ class GroupView(SecureModelView): class ExperimentView(SecureModelView): + def programQueryFactory(): + return Program.query + can_view_details = True column_filters = ["active"] @@ -380,6 +383,11 @@ class ExperimentView(SecureModelView): form_columns = column_details_list form_args = {"wiki_link": {"validators": [URL()]}} + form_extra_fields = { + "program": QuerySelectField( + "Program", query_factory=programQueryFactory, validators=[DataRequired()], allow_blank=True, blank_text="-" + ) + } def assistantQueryFactory():