information about the constructor. By default, the only keyword arguments passed to the Scanner constructor are {’config’:self} where self is this configurator object. This services the requirement of all built-in Pyramid decorators, but extension systems may require additional arguments. Providing this argument is not often necessary; it’s an advanced usage.
latex-note.png
the **kw argument is new in Pyramid 1.1
Adding Routes and Views
add_route(name, pattern=None, view=None, view_for=None, permission=None, factory=None, for_=None, header=None, xhr=False, accept=None, path_info=None, request_method=None, request_param=None, traverse=None, custom_predicates=(), view_permission=None, renderer=None, view_renderer=None, view_context=None, view_attr=None, use_global_views=False,
path=None, pregenerator=None, static=False)
Add a route configuration to the current configuration state, as well as possibly a view configuration to be used to specify a view callable that will be invoked when this route matches. The arguments to this method are divided into predicate, non-predicate, and view-related types. Route predicate arguments narrow the circumstances in which a route will be match a request; non-predicate arguments are informational.
Non-Predicate Arguments
name
The name of the route, e.g. myroute. This attribute is required. It must
be unique among all defined routes in a given application. |
|
factory |
|
A Python object (often a function or a class) or a dotted |
Python |
name which refers to the same object that will generate |
a Pyra- |
mid root resource object when this route matches. For example, mypackage.resources.MyFactory. If this argument is not specified, a default root factory will be used. See The Resource Tree for more information about root factories.
traverse