- class cubicweb.web.views.urlrewrite.URLRewriter(req, **extra)[source]#
Base class for URL rewriters.
Url rewriters should have a rules dict that maps an input URI to something that should be used for rewriting.
The actual logic that defines how the rules dict is used is implemented in the rewrite method.
A priority attribute might be used to indicate which rewriter should be tried first. The higher the priority is, the earlier the rewriter will be tried.
- class cubicweb.web.views.urlrewrite.SimpleReqRewriter(req, **extra)[source]#
The SimpleReqRewriters uses a rules dict that maps input URI (regexp or plain string) to a dictionary to update the request’s form.
If the input uri is a regexp, group substitution is allowed.
- class cubicweb.web.views.urlrewrite.SchemaBasedRewriter(req, **extra)[source]#
Here, the rules dict maps regexps or plain strings to callbacks that will be called with inputurl, uri, req, schema as parameters.