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


Python Search.add_group_by方法代码示例

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


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

示例1: init

# 需要导入模块: from pyasm.search import Search [as 别名]
# 或者: from pyasm.search.Search import add_group_by [as 别名]
 def init(self):
     search = Search(Bin)
     
     search.add_column('type')
     search.add_group_by('type')
     self.set_search_for_options(search, 'type','type')
     self.add_empty_option('-- Any --')
开发者ID:mincau,项目名称:TACTIC,代码行数:9,代码来源:submission_wdg.py

示例2: init

# 需要导入模块: from pyasm.search import Search [as 别名]
# 或者: from pyasm.search.Search import add_group_by [as 别名]
 def init(my):
     search = Search(Bin)
     
     search.add_column('label')
     search.add_group_by('label')
     my.set_search_for_options(search, 'label','label')
     my.add_empty_option('-- Any --')
开发者ID:0-T-0,项目名称:TACTIC,代码行数:9,代码来源:submission_wdg.py

示例3: categorize

# 需要导入模块: from pyasm.search import Search [as 别名]
# 或者: from pyasm.search.Search import add_group_by [as 别名]
    def categorize(my, widget, search_type, search):
        '''categorize parents based on search_type'''
        # FIXME: this should not be here.  This is a general class for all
        # search types, not just prod/asset
        if my.get_option('read_only') != 'true':
            if search_type == "prod/asset":
                lib_select = FilterSelectWdg('parent_lib')
                lib_select.persistence = False
                search2 = Search("prod/asset_library")
                lib_select.set_search_for_options( search2, "code", "title" )
                lib_select.add_empty_option("-- Any --")
                widget.add(lib_select) 
                # get all of the options for this search type
                parent_lib = lib_select.get_value()
                if parent_lib:
                    search.add_filter('asset_library', parent_lib)
            elif search_type == "prod/shot":
                lib_select = FilterSelectWdg('parent_lib')
                lib_select.persistence = False
                search2 = Search("prod/sequence")
                lib_select.set_search_for_options( search2, "code", "code" )
                lib_select.add_empty_option("-- Any --")
                
                widget.add(lib_select)

                # get all of the options for this search type
                parent_lib = lib_select.get_value()
                if parent_lib:
                    search.add_filter('sequence_code', parent_lib)
            elif search_type == 'prod/texture':
                lib_select = FilterSelectWdg('parent_lib')
                lib_select.persistence = False
                search2 = Search("prod/texture")
                search2.add_column('category')
                search2.add_group_by("category")
                lib_select.set_search_for_options( search2, "category", "category" )
                lib_select.add_empty_option("-- Any --")
                widget.add(lib_select)

                # get all of the options for this search type
                parent_lib = lib_select.get_value()
                if parent_lib:
                    search.add_filter('category', parent_lib)
开发者ID:0-T-0,项目名称:TACTIC,代码行数:45,代码来源:task_wdg.py

示例4: _get_bins

# 需要导入模块: from pyasm.search import Search [as 别名]
# 或者: from pyasm.search.Search import add_group_by [as 别名]
    def _get_bins(self):
        
        search = Search(Bin)

        # get all the types in the Bin table
        type_search = Search(Bin)
        type_search.add_column('type')
        type_search.add_group_by('type')
        types = SObject.get_values(type_search.get_sobjects(), 'type')

        select = SelectWdg('display_limit')
        select.set_option('persist', 'true')
        display_limit = select.get_value()
        if display_limit:
            self.display_limit = display_limit

        # by default, get 10 for each type
        joined_statements = []
        for type in types:
            # TODO: fix this sql to run through search
            select = Search('prod/bin')
            select.add_filter("type", type)
            select.set_show_retired(False)
            select.add_order_by("code")
            select.add_limit(self.display_limit)
            statement = select.get_statement()
            joined_statements.append(statement)

            #joined_statements.append("select * from \"bin\" where \"type\" ='%s' and (\"s_status\" != 'retired' or \"s_status\" is NULL)" \
            #    " order by \"code\" desc limit %s" % (type, self.display_limit))

        if len(joined_statements) > 1:
            joined_statements = ["(%s)"%x for x in joined_statements]
            statement = ' union all '.join(joined_statements)
        elif len(joined_statements) == 1:
            statement = joined_statements[0]
        else:
            # no bins created yet
            return []
        #print "statement: ", statement
    
        return Bin.get_by_statement(statement)
开发者ID:mincau,项目名称:TACTIC,代码行数:44,代码来源:submission_wdg.py

示例5: init

# 需要导入模块: from pyasm.search import Search [as 别名]
# 或者: from pyasm.search.Search import add_group_by [as 别名]
 def init(my):
     search = Search(CommandSObj)
     search.add_column('notification_code')
     search.add_group_by('notification_code')
     my.set_search_for_options(search, 'notification_code','notification_code')
开发者ID:CeltonMcGrath,项目名称:TACTIC,代码行数:7,代码来源:misc_input_wdg.py


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