Closed ffhan closed 5 years ago
Well, the argument to wtf.form_field()
should be a field object, but instead you are passing a rendered HTML version of the object. It does not seem possible to use the only_preview
and only_input
options with Flask-Bootstrap, I did not consider that usage, I would need to make some changes to enable that to work.
This issue will be automatically closed due to being inactive for more than six months. Please reopen if you need more assistance.
I am trying to render a form which has PageDownField inside of itself, but not with wtf.quick_form.
When I try rendering separate form fields like this:
{% block title %}Write a post!{% endblock %}
{% block scripts %} {{ super() }} {{ pagedown.include_pagedown() }} {% endblock %}
{% block fill_content %}
{% endblock %}
The problem seems in template, specifically in
{{ wtf.form_field(form.body(only_input = True, rows = 20)) }}
and I don't exactly know why. I am aware that the convention is to namePageDownField
elementpagedown
and use it accordingly, but that shouldn't be a problem.The error that I get on lines
wtf.form_field(form.body(...))
iswhich is being raised by
So my guess is that Flask-Bootstrap doesn't like Flask-PageDown? To be clear, the reason I'm trying to render those elements with wtf.form_field is that I want bootstrap theme applied to my custom form fields (I don't want to use wtf.quick_form() here)