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


Python MenuItem.set_submenu_tag_suffix方法代码示例

本文整理汇总了Python中tactic.ui.container.MenuItem.set_submenu_tag_suffix方法的典型用法代码示例。如果您正苦于以下问题:Python MenuItem.set_submenu_tag_suffix方法的具体用法?Python MenuItem.set_submenu_tag_suffix怎么用?Python MenuItem.set_submenu_tag_suffix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tactic.ui.container.MenuItem的用法示例。


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

示例1: get_display

# 需要导入模块: from tactic.ui.container import MenuItem [as 别名]
# 或者: from tactic.ui.container.MenuItem import set_submenu_tag_suffix [as 别名]

#.........这里部分代码省略.........
                'project_code': project_code,
                'cbjs_action': '''
                spt.app_busy.show("Jumping to Project ["+bvr.project_code+"]", "");
                document.location = '/tactic/%s/';
                ''' % project_code
                } )

            menu.add(menu_item)


        search = Search("sthpw/project")
        search.add_column("category", distinct=True)
        categories = [x.get_value("category") for x in search.get_sobjects() ]
        for category in categories:
            if category == '':
                continue

            # FIXME: a little inefficient, but should be ok for now
            category_projects = []
            for project in projects:
                if project.get_value("category") != category:
                    continue

                project_code = project.get_code()
                if not security.check_access("project", project_code, "view"):
                    continue
                
                category_projects.append(project)

            if category_projects:
                suffix = Common.get_filesystem_name(category)
                label = "%s (%s)" % (category, len(category_projects))
                menu_item = MenuItem(type='submenu', label=label)
                menu_item.set_submenu_tag_suffix(suffix)
                menu.add(menu_item)

                submenu = Menu(width=200, menu_tag_suffix=suffix)
                menus.append(submenu)
                for project in category_projects:
                    add_project_menu(submenu, project)


        from pyasm.security import get_security_version
        security_version = get_security_version()

        for project in projects:
            if project.get_value("category") != "":
                continue

            project_code = project.get_code()
            if security_version >= 2:
                key = { "code": project_code }
                key2 = { "code": "*" }
                keys = [key, key2]
                default = "deny"
                if not security.check_access("project", keys, "allow", default=default):
                    continue
            else:
                if not security.check_access("project", project_code, "view", default="allow"):
                    continue

            add_project_menu(menu, project)



        if not projects:
开发者ID:hellios78,项目名称:TACTIC,代码行数:70,代码来源:page_header_wdg.py


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