Home » Python Web » Flask-Admin 1.0.6新增的几个实用特性
  • 24
  • 10月

form_widget_args

这个就很强大了,之前的版本不能给Widget定义参数,1.0.5版本实现了。不多说了,直接看代码吧

class MyModelView(BaseModelView):
    form_widget_args = {
        content: {
            rows: 10,
            style: color: black
        }
    }

after_model_change

def after_model_change(form, model, is_created):
    pass

Perform some actions after a model was created or updated and committed to the database.

Called from create_model after successful database commit.

定义当模型创建或者修改更新到数据库之后执行的一些动作,比如博客的PING。

多语言支持

新增语种:French, Persian (Farsi), Chinese (Simplified/Traditional), Chech

这个目前还没搞懂怎么用。

批量删除

Bulk deletes go through delete_model

意思就是说批量删除要通过delete_model来删除

Model views default sorting

Model views now support default sorting order

is_visible

is_visible for administrative views

Tags:   flask .