Tuesday, April 1, 2014

Override ModelView Class - Flask-Admin

This has an awesome example of how to override your base ModelView: http://code.vokor.org/vokorbb/src/04de9dcb666d2fb35513ca29c97654b6eef80648/vokorbb/admin.py?at=tip

You would want to do this if you wanted to add something to all of your admin classes. Use cases:

  • If you wanted to require login by overriding is_accessible for all of your ModelViews.
  • If you wanted to add an export method to all of your ModelViews.

No comments:

Post a Comment