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


Python TreeNode._children方法代码示例

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


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

示例1: __init__

# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import _children [as 别名]
    def __init__(self, *args, **kwargs):

        super(Linkss, self).__init__(*args, **kwargs)

        laggadd = TreeNode('Add')
        laggadd.name = _(u'Create Link Aggregation')
        laggadd.view = 'freeadmin_network_lagginterface_add'
        laggadd.type = 'object'
        laggadd.icon = u'AddLAGGIcon'
        laggadd.model = 'LAGGInterface'
        laggadd.app_name = 'network'

        laggview = TreeNode('View')
        laggview.gname = 'View'
        laggview.name = _(u'View Link Aggregations')
        laggview.type = 'opennetwork'
        laggview.icon = u'ViewAllLAGGsIcon'
        laggview.model = 'LAGGInterface'
        laggview.app_name = 'network'
        self.append_children([laggadd, laggview])

        for value, name in LAGGType:

            laggs = models.LAGGInterface.objects.filter(lagg_protocol__exact=value)
            if laggs.count() > 0:
                nav = TreeNode()
                nav.name = name
                nav.icon = u'LAGGIcon'
                nav._children = []
                self.append_child(nav)

            for lagg in laggs:

                subnav = TreeNode()
                subnav.name = lagg.lagg_interface.int_name
                subnav.icon = u'LAGGIcon'
                subnav._children = []
                nav.append_child(subnav)

                laggm = models.LAGGInterfaceMembers.objects.filter(
                    lagg_interfacegroup__exact=lagg.id
                ).order_by('lagg_ordernum')
                for member in laggm:
                    subsubnav = TreeNode()
                    subsubnav.name = member.lagg_physnic
                    subsubnav.type = 'editobject'
                    subsubnav.icon = u'LAGGIcon'
                    subsubnav.view = 'freeadmin_network_lagginterfacemembers_edit'
                    subsubnav.app_name = 'network'
                    subsubnav.model = 'LAGGInterfaceMembers' + lagg.lagg_interface.int_name
                    subsubnav.kwargs = {'oid': member.id}
                    subsubnav.append_url = '?deletable=false'
                    subsubnav._children = []
                    subnav.append_child(subsubnav)
开发者ID:Cbrdiv,项目名称:freenas,代码行数:56,代码来源:nav.py

示例2: __init__

# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import _children [as 别名]
    def __init__(self, *args, **kwargs):

        super(Linkss, self).__init__(*args, **kwargs)

        laggadd = TreeNode("Add")
        laggadd.name = _(u"Create Link Aggregation")
        laggadd.view = "freeadmin_network_lagginterface_add"
        laggadd.type = "object"
        laggadd.icon = u"AddLAGGIcon"
        laggadd.model = "LAGGInterface"
        laggadd.app_name = "network"

        laggview = TreeNode("View")
        laggview.gname = "View"
        laggview.name = _(u"View Link Aggregations")
        laggview.type = "opennetwork"
        laggview.icon = u"ViewAllLAGGsIcon"
        laggview.model = "LAGGInterface"
        laggview.app_name = "network"
        self.append_children([laggadd, laggview])

        for value, name in LAGGType:

            laggs = models.LAGGInterface.objects.filter(lagg_protocol__exact=value)
            if laggs.count() > 0:
                nav = TreeNode()
                nav.name = name
                nav.icon = u"LAGGIcon"
                nav._children = []
                self.append_child(nav)

            for lagg in laggs:

                subnav = TreeNode()
                subnav.name = lagg.lagg_interface.int_name
                subnav.icon = u"LAGGIcon"
                subnav._children = []
                nav.append_child(subnav)

                laggm = models.LAGGInterfaceMembers.objects.filter(lagg_interfacegroup__exact=lagg.id).order_by(
                    "lagg_ordernum"
                )
                for member in laggm:
                    subsubnav = TreeNode()
                    subsubnav.name = member.lagg_physnic
                    subsubnav.type = "editobject"
                    subsubnav.icon = u"LAGGIcon"
                    subsubnav.view = "freeadmin_network_lagginterfacemembers_edit"
                    subsubnav.app_name = "network"
                    subsubnav.model = "LAGGInterfaceMembers" + lagg.lagg_interface.int_name
                    subsubnav.kwargs = {"oid": member.id}
                    subsubnav.append_url = "?deletable=false"
                    subsubnav._children = []
                    subnav.append_child(subsubnav)
开发者ID:bionoren,项目名称:freenas,代码行数:56,代码来源:nav.py


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