class documentation

class RuleTemplate:

View In Hierarchy

Returns copies of the rules wrapped and expands string templates in the endpoint, rule, defaults or subdomain sections.

Here a small example for such a rule template:

from werkzeug.routing import Map, Rule, RuleTemplate

resource = RuleTemplate([
    Rule('/$name/', endpoint='$name.list'),
    Rule('/$name/<int:id>', endpoint='$name.show')
])

url_map = Map([resource(name='user'), resource(name='page')])

When a rule template is called the keyword arguments are used to replace the placeholders in all the string parameters.

Method __call__ Undocumented
Method __init__ Undocumented
Instance Variable rules Undocumented
def __call__(self, *args, **kwargs):

Undocumented

Parameters
*args:t.AnyUndocumented
**kwargs:t.AnyUndocumented
Returns
RuleTemplateFactoryUndocumented
def __init__(self, rules):

Undocumented

Parameters
rules:t.Iterable[Rule]Undocumented
rules =

Undocumented