本文整理汇总了Python中book.Book.getView方法的典型用法代码示例。如果您正苦于以下问题:Python Book.getView方法的具体用法?Python Book.getView怎么用?Python Book.getView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类book.Book
的用法示例。
在下文中一共展示了Book.getView方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: site_map
# 需要导入模块: from book import Book [as 别名]
# 或者: from book.Book import getView [as 别名]
@app.route("/site-map")
@login_required
def site_map():
links = []
for rule in app.url_map.iter_rules():
links.append(rule.endpoint + ' ' + str(rule))
return '<br>'.join(links)
@app.route('/login', methods=["GET", "POST"])
def login(next=None):
next = next or request.referrer or url_for('index', _external=True)
url = app.config['T2_URL'] + 'signin/?next=%s' % urllib.quote(next)
return redirect(url)
@app.route('/logout')
def logout(next=None):
g.user = None
url = next or request.referrer or url_for('index')
resp = make_response(redirect(url))
resp.set_cookie('remember_token', '', expires=0)
return resp
@app.template_global(name='zip')
def _zip(*args, **kwargs): #to not overwrite builtin zip in globals
return __builtins__['zip'](*args, **kwargs)
# the main routes come from the Book model
Book.getView().register(app)
Bread.getView().register(app)