本文整理匯總了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)