Docs mention query args now. This fixes #20

This commit is contained in:
Armin Ronacher 2010-05-02 11:36:42 +02:00
parent 31493850de
commit f1603d33f2
2 changed files with 10 additions and 1 deletions

View file

@ -160,6 +160,8 @@ The following converters exist:
`path` like the default but also accepts slashes
=========== ===========================================
.. _url-building:
URL Building
````````````
@ -167,7 +169,8 @@ If it can match URLs, can it also generate them? Of course you can. To
build a URL to a specific function you can use the :func:`~flask.url_for`
function. It accepts the name of the function as first argument and a
number of keyword arguments, each corresponding to the variable part of
the URL rule. Here some examples:
the URL rule. Unknown variable parts are appended to the URL as query
parameter. Here some examples:
>>> from flask import Flask, url_for
>>> app = Flask(__name__)
@ -184,9 +187,11 @@ the URL rule. Here some examples:
... print url_for('index')
... print url_for('login')
... print url_for('profile', username='John Doe')
... print url_for('login', next='/')
...
/
/login
/login?next=/
/user/John%20Doe
(This also uses the :meth:`~flask.Flask.test_request_context` method