当前位置: 首页>>代码示例>>Python>>正文


Python tg.TGController类代码示例

本文整理汇总了Python中tg.TGController的典型用法代码示例。如果您正苦于以下问题:Python TGController类的具体用法?Python TGController怎么用?Python TGController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TGController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, form, onSuccessFunc=None, *args, **kw):
     """(form, onSuccessFunc=None, *args, **kw)
     This class creates a handler which handles all of the 
     
     
     """
     self.form = form
     self.onSuccessFunc = onSuccessFunc
     TGController.__init__(self, args, kw)
开发者ID:desarrollo1,项目名称:tg2env,代码行数:9,代码来源:activeform.py

示例2: __call__

    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity

        #return TGController.__call__(self, environ, start_response)
        stream = TGController.__call__(self, environ, start_response)
         
        # Disable the injection of tw2.jquery
        #offending_link = tw2.jquery.jquery_js.req().link
        local = tw2.core.core.request_local()

        res = []
        for r in local.get('resources', list()):
            #if r.link != offending_link:
            r.link = url(r.link)
            res.append(r)
        
        local['resources'] = res    
            
        return stream
开发者ID:preinh,项目名称:seisPortal,代码行数:25,代码来源:base.py

示例3: __call__

    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity

        # Include jquery on every page.
        tw2.jquery.jquery_js.req().prepare()

        # Set the theme to 'hot-sneaks'
        tw2.jqplugins.ui.set_ui_theme_name('hot-sneaks')

        if 'login' not in environ['PATH_INFO']:
            for link in ["query.js", "cards.js", "navigation.js"]:
                twc.JSLink(link="javascript/%s" % link).req().prepare()

            tmpl_context.hotkeys_dialog = HotkeysDialog
            tmpl_context.search_dialog = SearchDialog
            tmpl_context.leaderboard_dialog = LeaderboardDialog
            tmpl_context.statistics_dialog = StatisticsDialog
            tmpl_context.user_widget = UserWidget
            if request.identity:
                tmpl_context.add_dialog = AddTagDialog

        return TGController.__call__(self, environ, start_response)
开发者ID:ralphbean,项目名称:fedora-tagger,代码行数:28,代码来源:base.py

示例4: __call__

    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        return TGController.__call__(self, environ, start_response)
开发者ID:rwilcox,项目名称:turbogears2_webservices_example,代码行数:7,代码来源:base.py

示例5: __call__

 def __call__(self, environ, start_response):
     """Invoke the Controller"""
     # TGController.__call__ dispatches to the Controller method
     # the request is routed to. This routing information is
     # available in environ['pylons.routes_dict']
     request.identity = request.environ.get("repoze.who.identity")
     tmpl_context.identity = request.identity
     return TGController.__call__(self, environ, start_response)
开发者ID:SergeyLashin,项目名称:mediacore,代码行数:8,代码来源:root.py

示例6: __call__

    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        tmpl_context.in_production = asbool(config.get('in_production'))
        return TGController.__call__(self, environ, start_response)
开发者ID:ralphbean,项目名称:hanginwit-threebean,代码行数:8,代码来源:base.py

示例7: __call__

    def __call__(self, environ, context):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to.

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity
        return TGController.__call__(self, environ, context)
开发者ID:enriquebits,项目名称:bookmanizer,代码行数:8,代码来源:base.py

示例8: __call__

    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        #tmpl_context.notif = mokshaandtg.widgets.NotificationWidget(id='foo').display()
        tmpl_context.notif = moksha.utils.get_widget('garbage').display()
        # I want to use my own lib/base
        tmpl_context.globs = moksha.lib.base.global_resources()

        return TGController.__call__(self, environ, start_response)
开发者ID:ralphbean,项目名称:moksha-and-tg,代码行数:12,代码来源:base.py

示例9: __call__

    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity
        tmpl_context.rst_to_html = rst_to_html
        tmpl_context.gaid = config.get('ga_verifier', None)
        tmpl_context.analyticsid = config.get('analyticsid', None)
        return TGController.__call__(self, environ, start_response)
开发者ID:TurboGears,项目名称:tg2tut,代码行数:12,代码来源:base.py

示例10: __call__

    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        request.identity = request.environ.get('repoze.who.identity')
        # para acceder mas rapido a este componente
        request.credentials = request.environ.get('repoze.what.credentials')
        request.puede_gestion_conf = False
        request.puede_desarrollo = False
        
        if request.credentials:
            username = request.credentials["repoze.what.userid"]
            usuario = model.Usuario.by_user_name(username)
            request.puede_proyecto = False
            request.puede_rol = False
            request.puede_fase = False
            request.puede_ti = False
            request.puede_busqueda = False
            
            if AlgunPermiso(tipo="Rol").is_met(request.environ):
                request.puede_rol = True

            perms = request.credentials["permissions"]
            if perms.count("crear proyecto") or \
               perms.count("modificar proyecto") or \
               perms.count("eliminar proyecto"):
                request.puede_proyecto = True
            
            if perms.count("modificar fase"):
                request.puede_fase = True
            
            if perms.count("crear tipo item") or \
               perms.count("redefinir tipo item"):
                request.puede_ti = True
            
            if AlgunPermiso(tipo="Usuario").is_met(request.environ):
                request.puede_busqueda = True
                
            if AlgunPermiso(tipo="Tipo").is_met(request.environ):
                request.puede_desarrollo = True
                
            if has_any_permission(u"crear lb", u"abrir-cerrar lb", 
                                  u"consultar lb").is_met(request.environ):
                request.puede_gestion_conf = True
			
        tmpl_context.identity = request.identity
#        session['atras'] = session['actual']
#        session['actual'] = session['adelante']
        
        session.save()
        return TGController.__call__(self, environ, start_response)
开发者ID:jorgeramirez,项目名称:LPM,代码行数:53,代码来源:base.py

示例11: __call__

    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity

        tmpl_context.notification_widget = tutorial.widgets.PopupNotification
        tmpl_context.moksha_global_resources = global_resources

        return TGController.__call__(self, environ, start_response)
开发者ID:mokshaproject,项目名称:moksha-turbogears2-hello_world,代码行数:13,代码来源:base.py

示例12: __call__

    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity
        jquery_js.inject()
#        from tw.jquery.ui import ui_tabs_js, jquery_ui_all_js
#        from tw.uitheme import uilightness_css
#        jquery_ui_all_js.inject()
#        uilightness_css.inject()
        return TGController.__call__(self, environ, start_response)
开发者ID:sysnux,项目名称:astportal,代码行数:14,代码来源:base.py

示例13: __call__

    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        # Create a container to send widgets to the template. Only those sent
        # in here will have their resources automatically included in the
        # template
        context.w = WidgetBunch()
        context.css = dbsprocketsCss
        try:
            return TGController.__call__(self, environ, start_response)
        finally:
            pass
开发者ID:arianepaola,项目名称:tg2jython,代码行数:15,代码来源:dbmechanic.py

示例14: __call__

    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity

        tmpl_context.menu_widget = MainMenu
        tmpl_context.dialog_widget = ReadmeDialog
        tmpl_context.from_date_widget = FromDateWidget
        tmpl_context.to_date_widget = ToDateWidget
        set_ui_theme_name('excite-bike')

        return TGController.__call__(self, environ, start_response)
开发者ID:ralphbean,项目名称:monroe,代码行数:16,代码来源:base.py

示例15: __call__

    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        set_ui_theme_name('hot-sneaks')

        entry = model.ServerHit(
            remote_addr=environ['REMOTE_ADDR'],
            path_info=environ['PATH_INFO'],
            query_string=environ['QUERY_STRING'],
        )
        model.DBSession.add(entry)
        model.DBSession.flush()

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity
        return TGController.__call__(self, environ, start_response)
开发者ID:ralphbean,项目名称:tw2-facemelt-tg2.1,代码行数:19,代码来源:base.py


注:本文中的tg.TGController类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。