Did I find the right examples for you? yes no

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
:type config: pyramid.config.Configurator

        def add_model_view(config, model, view_cls=None, actions=None):
    """
    :type config: pyramid.config.Configurator
    """
    model_helper.register_model(model)

    if view_cls is None:
        view_cls = ModelView
    mgr = model.__backend_manager__
    """:type : pyramid_backend.backend_manager.Manager"""
    if actions is None:
        actions = mgr.default_actions
    for action_conf in actions:
        action_name, action_conf = mgr.normalize_action(action_conf)
        if 'view' not in action_conf:
            action_conf['view'] = view_cls
        _add_action_view(config, model, action_name, **action_conf)
        


src/p/y/pyramid_backend_vgid_oauth2-1.0.2/pyramid_backend_vgid_oauth2/__init__.py   pyramid_backend_vgid_oauth2(Download)
__author__ = 'tarzan'
 
from pyramid.authentication import AuthTktAuthenticationPolicy
from pyramid_vgid_oauth2 import set_put_user_callback
from pyramid_backend.views import add_model_view
    config.set_authentication_policy(auth_policy)
    config.set_request_property(adapter.get_user_for_request, 'authenticated_user', reify=True)
    add_model_view(config, model=BackendUser)