Add basic/generic Buefy support to the Form class

mostly just affects rendering, apparently backend logic needn't really change?
This commit is contained in:
Lance Edgar 2019-05-20 16:24:14 -05:00
parent a125e381a9
commit dfe0f49655
4 changed files with 12 additions and 3 deletions

View file

@ -97,6 +97,10 @@ class MasterView(View):
supports_prev_next = False
supports_import_batch_from_file = False
# whether or not Buefy is supported for CRUD forms. we're turning this on,
# "one view at a time" until it makes sense for that to be global default.
supports_buefy_forms = False
# quickie (search)
supports_quickie_search = False
expose_quickie_search = False
@ -2823,6 +2827,7 @@ class MasterView(View):
'readonly': self.viewing,
'model_class': getattr(self, 'model_class', None),
'action_url': self.request.current_route_url(_query=None),
'use_buefy': self.supports_buefy_forms and self.get_use_buefy(),
}
if self.creating:
kwargs.setdefault('cancel_url', self.get_index_url())

View file

@ -350,7 +350,8 @@ class GenerateReport(View):
schema.add(node)
form = forms.Form(schema=schema, request=self.request)
form = forms.Form(schema=schema, request=self.request,
use_buefy=self.get_use_buefy())
form.submit_label = "Generate this Report"
form.cancel_url = self.request.route_url('generate_report')