python - What is default_view used for? -
i saw code example in flask-appbuilder website.but never explained default_view used for. try dig documentation no avail. care explain me this?
from flask.ext.appbuilder import appbuilder, expose, baseview, has_access app import appbuilder class myview(baseview): default_view = 'method1' @expose('/method1/') @has_access def method1(self): # param1 # , return previous page or index return 'hello' @expose('/method2/<string:param1>') @has_access def method2(self, param1): # param1 # , render template param param1 = 'goodbye %s' % (param1) return param1 appbuilder.add_view(myview, "method1", category='my view') appbuilder.add_link("method2", href='/myview/method2/john', category='my view')
Comments
Post a Comment