Skip to content

Views BaseView

Kyle J. Roux edited this page Sep 7, 2015 · 2 revisions

Views

the flask_xxl.baseviews.BaseView class inherits from the flask.views.MethodView class, but adds a few helpers,

  • methods

    • BaseView.render -> calls flask.render_template(View._template,**View._context)
      • If you need custom rendering, say to render content from your db, still using the context just redefine render in a SubClass
    • BaseView.success(msg) -> calls flask.flash(msg,'succcess')
    • BaseView.error(msg) -> calls flask.flash(msg,'error')
  • attrs

    • _template -> template rendered when BaseView.render() called
    • _context -> context rendered with template
Clone this wiki locally