OK. I understood this after reading the source code of ModelView.
First, make sure the endpoints are named (it is possible to do this without named endpoints, but this makes the code more understandable):
from flask.ext.admin.contrib.sqla import ModelView from models import db, User, Role admin = Admin(app, name="Boost Admin") admin.add_view(ModelView(User,db.session,category="model", endpoint="model_view_user")) admin.add_view(ModelView(Role,db.session,category="model", endpoint="model_view_role"))
... now in the template you can refer to the representation of the base model as follows:
URL for User model default view is: {{model_view_user.index_view}} URL for Role model default view is: {{model_view_role.index_view}}
The index_view function index_view defined here and implements the default view for the ModelView flag manager.
source share