petrus-jvrensburg petrus-jvrensburg - 2 years ago 167
Python Question

Modify input field sizes in Flask-Admin

Does anyone know of an easy way to specify a size for input fields in Flask-Admin?

E.g. setting

on an input field does the trick, but is there a simple way to do that from Flask-Admin?

Answer Source

Use form_widget_args.

For example:

class MyModelView(BaseModelView):
    form_widget_args = {
        'description': {
            'rows': 10,
            'class': 'input-xlarge'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download