How to override a form in Flask-Admin with HTML/Javascript?

时间:2019-03-28 19:39:22

标签: python flask flask-admin

In Flask-Admin, I have a form for receiving tags, but I am trying to override this form with a javascript input form to format the tags as they are typed in.

So far, I understand this is a way to override the form when you have a nice FlaskForm via form_override

class CustomModelView(ModelView):
    form_overrides = dict(tags=wtf.Filefield)

But the form I want to override with comes in this form

    <script type="text/javascript" src="{{ url_for('static', filename = 'bootstrap-tagsinput.js') }}"></script>
    <input type="text" data-role="tagsinput"/>

Do I need to override the template instead, or is there a way to get the javascript in the form_overrides dictionary?

0 个答案:

没有答案