Ejemplo n.º 1
0
def _get_route_data(route, registry):
    """Iterate all non static views for a route.

    :param route: Route introspection data
    :param registry:
    :yield: (route name, route pattern, view introspection data) tuples
    """

    pattern = _get_pattern(route)

    request_iface = registry.queryUtility(IRouteRequest, name=route.name)

    route_intr = registry.introspector.get('routes', route.name)

    if request_iface is None:
        return

    if route_intr.get('static', False) is True:
        return

    view_intr = registry.introspector.related(route_intr)

    if view_intr:
        for view in view_intr:
            yield route.name, pattern, view
Ejemplo n.º 2
0
def _get_route_data(route, registry):
    """Iterate all non static views for a route.

    :param route: Route introspection data
    :param registry:
    :yield: (route name, route pattern, view introspection data) tuples
    """

    pattern = _get_pattern(route)

    request_iface = registry.queryUtility(
        IRouteRequest,
        name=route.name
    )

    route_intr = registry.introspector.get(
        'routes', route.name
    )

    if request_iface is None:
        return

    if route_intr.get('static', False) is True:
        return

    view_intr = registry.introspector.related(route_intr)

    if view_intr:
        for view in view_intr:
            yield route.name, pattern, view