def edit_form(self, obj=None): """ Instantiate model editing form and return it. Override to implement custom behavior. """ form_obj = self._edit_form_class(get_form_data(), obj=obj) form_obj.tests.choices = get_all_test_choices() return form_obj
def this_form_get(self, report_title): self._init_vars() form = self.form.refresh() form = self.form_get(form, report_title) form.tests.choices = get_all_test_choices() if form: widgets = self._get_edit_widget(form=form) self.update_redirect() return self.render_template( self.form_template, title=self.form_title, widgets=widgets, appbuilder=self.appbuilder, ) flash(f"report title ({report_title}) not found.", "error") return redirect(url_for("ReportsView.list"))
def form_get(self, form): form.tests.choices = get_all_test_choices() return form