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


Python Search.do_search方法代码示例

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


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

示例1: get_by_search_type

# 需要导入模块: from pyasm.search import Search [as 别名]
# 或者: from pyasm.search.Search import do_search [as 别名]
    def get_by_search_type(search_type):

        search = Search(Template.SEARCH_TYPE)
        search.add_filter("search_type", search_type)

        search.add_order_by("timestamp desc")

        return search.do_search()
开发者ID:0-T-0,项目名称:TACTIC,代码行数:10,代码来源:template.py

示例2: handle_add_instance

# 需要导入模块: from pyasm.search import Search [as 别名]
# 或者: from pyasm.search.Search import do_search [as 别名]
    def handle_add_instance(self, set):

        WebContainer.register_cmd("pyasm.prod.web.SetCheckinCbk")

        self.add(DivWdg("Comments:"))
        textarea = TextAreaWdg("description")
        textarea.set_attr("cols", "30")
        textarea.set_attr("rows", "2")
        self.add(textarea)

        set_name = set.get_value("name")
        
        button = ProdIconSubmitWdg(self.PUBLISH_BUTTON, long=True)
        button.add_event("onclick", "if (checkin_set('%s','%s')!=true) return" \
            % (set_name, set.get_code() ))
        self.add(button)


        

        # get all of the assets belonging to this set
        search = Search("prod/asset")
        search.add_regex_filter('code', set_name, op='EQ' )
        set_assets = search.do_search()
开发者ID:mincau,项目名称:TACTIC,代码行数:26,代码来源:maya_set_wdg.py

示例3: init

# 需要导入模块: from pyasm.search import Search [as 别名]
# 或者: from pyasm.search.Search import do_search [as 别名]
    def init(my):

        web = WebContainer.get_web()
        search_type = web.get_form_value("search_type")
        search_ids = web.get_form_values("search_ids")

        download_types = web.get_form_values("download_types")

        search = Search(search_type)
        sobjects = []

        if search_ids:
            search.add_where("id in (%s)" % ", ".join(search_ids))
            sobjects = search.do_search()

        if not sobjects:
            message = HtmlElement.p("No %s to download." % search.get_search_type_obj().get_title())
            message.set_class("warning")
            my.add(message)
            return

        download_wdg = DownloadWdg()
        my.add(download_wdg)

        outer_div = DivWdg(css="admin_main")
        table = Table()
        table.set_class("table")

        # add download buttons

        widget = HtmlElement.div()
        # button = SubmitWdg("Download All")
        # widget.add(button)
        button = SubmitWdg("Download Selected")
        widget.add(button)
        tr, th = table.add_row_header(widget)
        th.add_style("text-align: center")

        # add all of the
        # widget = HtmlElement.div()
        # widget.add("<b>Download options:</b>")
        # for type in download_types:
        #    widget.add( CheckboxWdg(type) )
        #    widget.add( type)
        # tr, th = table.add_row_header(widget)
        # th.add_style("text-align: center")

        # add all of the sobjects
        col = 0
        for sobject in sobjects:

            if col == 0 or col % 3 == 0:
                table.add_row()

            search_id = sobject.get_id()

            icon_wdg = ThumbWdg()
            icon_wdg.set_name("snapshot")
            icon_wdg.set_sobject(sobject)

            div = HtmlElement.div()
            div.set_style("background-color: #f0f0f0")
            div.set_style("height: 100%")

            checkbox = CheckboxWdg("download_files")
            checkbox.set_option("value", "%s|%s" % (search_type, search_id))
            div.add(checkbox)
            if sobject.has_value("code"):
                div.add("<b>%s</b>" % sobject.get_value("code"))
            div.add("<br/>")

            div.add(icon_wdg)

            if sobject.has_value("code"):
                div.add(sobject.get_value("description"))

            td = table.add_cell(div)
            td.add_style("height: 120px")
            td.add_style("widget: 200px")

            col += 1

        outer_div.add(table)

        my.add(outer_div)
开发者ID:hellios78,项目名称:TACTIC,代码行数:87,代码来源:sobject_upload_wdg.py


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