I am trying to create a custom edit-view in Flask-Admin where I use the original edit form and add more content to it.
I want to use in my template the original:
{% extends 'admin/master.html' %}
{% import 'admin/lib.html' as lib with context %}
(...)
{% block edit_form %}
{{ lib.render_form(form, return_url, extra(), form_opts) }}
{% endblock %}
But I am having trouble passing the original form to the self.render(...)
function in my custom view:
class MyView(sqla.ModelView):
# (view options)
@expose('/edit/', methods=('GET', 'POST'))
def edit_view(self):
# (custom view variables)
return self.render('my_edit_view.html')
I believe I have to pass some parameters in the self.render
function. I tried to include a form = form
but it didn't work (TypeError: 'module' object is not iterable
)...
Any ideas?
Thanks!!