[Flask] need help on request.view_args

夏天的风 langslike at foxmail.com
Tue Jan 19 03:00:48 EST 2016


------------------ 原始邮件 ------------------
发件人: "夏天的风";<langslike at foxmail.com>;
发送时间: 2016年1月19日(星期二) 下午3:47
收件人: "flask-request"<flask-request at python.org>; 

主题: help on request.view_args



Hi
I'm reading some web application code using flask, and the variable request.view_args confuses me: the url http://**?a=1 means that the associated request.args['a'] will be 1, how about view_args? how to set view_args for a request? and what's the general purpose of using it? I read the flask documentation ,but the description is too short .I googled but found most of the usage of view_args deals with pagination: 
http://flask.pocoo.org/snippets/44/
def url_for_other_page(page):     args = request.view_args.copy()     args['page'] = page     return url_for(request.endpoint, **args) app.jinja_env.globals['url_for_other_page'] = url_for_other_page
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160119/ab93e613/attachment.html>


More information about the Flask mailing list