當前位置: 首頁>>代碼示例>>Python>>正文


Python TableWdg.do_search方法代碼示例

本文整理匯總了Python中pyasm.widget.TableWdg.do_search方法的典型用法代碼示例。如果您正苦於以下問題:Python TableWdg.do_search方法的具體用法?Python TableWdg.do_search怎麽用?Python TableWdg.do_search使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyasm.widget.TableWdg的用法示例。


在下文中一共展示了TableWdg.do_search方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_display

# 需要導入模塊: from pyasm.widget import TableWdg [as 別名]
# 或者: from pyasm.widget.TableWdg import do_search [as 別名]
    def get_display(self):

        web = WebContainer.get_web()
        args = web.get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type,search_id) )

        planner_search_type = self.get_search_type()


        # get parent instances first
        '''
        all_instances = []
        parent_code = ""
        if sobject.has_value("parent_code"):
            parent_code = sobject.get_value("parent_code")
        if parent_code != "":
            parent = sobject.get_by_code(parent_code)

            search = Search(planner_search_type)
            search.add_filter(sobject.get_foreign_key(), parent.get_code())
            instances = search.get_sobjects()

            all_instances.extend(instances)
        '''


        search = Search(planner_search_type)
        search.add_filter(sobject.get_foreign_key(), sobject.get_code())
        instances = search.get_sobjects()
        #all_instances.extend(instances)

        widget = DivWdg()
        widget.add( HiddenWdg("planner_search_type", planner_search_type) )
        widget.add_style("width: 95%")
        widget.add_style("float: right")
        table = TableWdg(search_type, "layout", css='minimal')
        table.table.set_max_width(use_css=True)
        #table.set_sobjects(all_instances)
        table.set_search(search)
        table.do_search()
        table.set_show_property(False)

        #aux_data = ShotInstance.get_aux_data(all_instances)
        #table.set_aux_data(aux_data)
        widget.add(table)
        return widget
開發者ID:mincau,項目名稱:TACTIC,代碼行數:53,代碼來源:sobject_planner_wdg.py

示例2: get_display

# 需要導入模塊: from pyasm.widget import TableWdg [as 別名]
# 或者: from pyasm.widget.TableWdg import do_search [as 別名]
    def get_display(my):
        search_type = my.options.get("search_type")
        view = my.options.get("view")
        filter = my.options.get("filter")
        if type(filter) in types.StringTypes:
            filters = [filter]
        elif not filter:
            filters = []
        else:
            filters = filter

        # create the search
        search = Search(search_type)

        widget = Widget()
        div = DivWdg(css="filter_box")
        widget.add(div)

        for i, filter in enumerate(filters):

            if filter.find("|") != -1:
                filter_name, expression = filter.split("|", 1)
            else:
                filter_name = filter
                expression = None


            span = SpanWdg(css="med")

            filter_wdg = Container.get_dict("widgets", filter_name)
            if not filter_wdg:
                filter_wdg = Common.create_from_class_path(filter_name)
                span.add(filter_wdg)
                div.add(span)
            else:
                span.add("%s: " % filter_wdg.get_name())

            if expression:
                name = filter_wdg.get_name()
                value = filter_wdg.get_value()
                if value != "":
                    expression = expression.replace("{name}", name)
                    expression = expression.replace("{value}", value)
                    search.add_where(expression)
            else:
                filter_wdg.alter_search(search)

            filter_wdg.set_name(filter_name)

            span = SpanWdg(css="med")
            span.add("%s: " % filter_name)
            span.add(filter_wdg)
            div.add(span)


        table = TableWdg(search_type, view)
        table.set_search(search)
        table.do_search()
        
        widget.add(table)
        return widget
開發者ID:CeltonMcGrath,項目名稱:TACTIC,代碼行數:63,代碼來源:custom_info_wdg.py


注:本文中的pyasm.widget.TableWdg.do_search方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。