class documentation
A Router is an ordered collection of route->target pairs. It is used to efficiently match WSGI requests against a number of routes and return the first target that satisfies the request. The target may be anything, usually a string, ID or callable object. A route consists of a path-rule and a HTTP method. The path-rule is either a static path (e.g. `/contact`) or a dynamic path that contains wildcards (e.g. `/wiki/<page>`). The wildcard syntax and details on the matching order are described in docs:`routing`.
Method | __init__ |
Undocumented |
Method | add |
Add a new rule or replace the target for an existing rule. |
Method | add |
Add a filter. The provided function is called with the configuration string as parameter and must return a (regexp, to_python, to_url) tuple. The first element is a string, the last two are callables or None... |
Method | build |
Build an URL by filling the wildcards in a rule. |
Method | match |
Return a (target, url_agrs) tuple or raise HTTPError(400/404/405). |
Class Variable | default |
Undocumented |
Class Variable | default |
Undocumented |
Class Variable | rule |
Undocumented |
Instance Variable | builder |
Undocumented |
Instance Variable | dyna |
Undocumented |
Instance Variable | dyna |
Undocumented |
Instance Variable | filters |
Undocumented |
Instance Variable | rules |
Undocumented |
Instance Variable | static |
Undocumented |
Instance Variable | strict |
Undocumented |
Method | _compile |
Undocumented |
Method | _itertokens |
Undocumented |
Constant | _MAX |
Undocumented |
Instance Variable | _groups |
Undocumented |
Add a filter. The provided function is called with the configuration string as parameter and must return a (regexp, to_python, to_url) tuple. The first element is a string, the last two are callables or None.