Beispiel #1
0
explicit_routes = lambda: [
    controller('/',
               SiteController,
               rules=[
                   rule('/', 'index'),
                   rule('/about', 'about'),
                   rule('/terms', 'terms'),
               ]),
    resource('/users',
             UserResource,
             rules=[],
             subresources=[
                 resource('/roles', RoleResource),
             ]),
    controller('/products', ProductController),
    func('/simple', simple),
    include('tests.bundles.controller.fixtures.other_bp_routes',
            attr='explicit'),
]

implicit_routes = lambda: [
    controller(SiteController),
    resource(UserResource, subresources=[
        resource(RoleResource),
    ]),
    prefix('/products', [
        controller(ProductController),
    ]),
    func(simple),
    include('tests.bundles.controller.fixtures.other_bp_routes',
            attr='implicit'),
Beispiel #2
0
from flask_unchained.bundles.controller import func

from .views import view_three, view_four


routes = lambda: [
    func(view_three),
    func(view_four),
]
Beispiel #3
0
from flask_unchained.bundles.controller import func, prefix, include

from .bp_views import one, two, three

implicit = lambda: [
    func(one),
    func(two),
    func(three),
]

explicit = lambda: [
    func('/one', one),
    func('/two', two),
    func('/three', three),
]

recursive = lambda: [
    include('tests.bundles.controller.fixtures.other_bp_routes',
            attr='explicit'),
    prefix('/deep', [
        include('tests.bundles.controller.fixtures.other_bp_routes',
                attr='implicit')
    ]),
]
Beispiel #4
0
from .views import silly_condition

from flask_unchained.bundles.controller import func


routes = lambda: [
    func(silly_condition),
]