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():