-
Notifications
You must be signed in to change notification settings - Fork 21
Views BaseView
Kyle J. Roux edited this page Sep 7, 2015
·
2 revisions
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')
- BaseView.render -> calls flask.render_template(View._template,**View._context)
-
attrs
- _template -> template rendered when
BaseView.render()
called - _context -> context rendered with template
- _template -> template rendered when
Jstacoder jstacoder@gmail.com
Examples