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


Python Search.add_filter方法代码示例

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


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

示例1: delete_all_redo

# 需要导入模块: from search import Search [as 别名]
# 或者: from search.Search import add_filter [as 别名]
    def delete_all_redo():
        user_name = Environment.get_user_name()

        search = Search("sthpw/transaction_log")
        search.add_order_by("timestamp")
        search.add_filter("type", "redo")
        search.add_filter("login", user_name)
        transaction_logs = search.do_search()

        for transaction_log in transaction_logs:
            transaction_log.delete()
开发者ID:2gDigitalPost,项目名称:tactic_src,代码行数:13,代码来源:transaction_log.py

示例2: get_by_ticket

# 需要导入模块: from search import Search [as 别名]
# 或者: from search.Search import add_filter [as 别名]
    def get_by_ticket(ticket):
        search = Search(TransactionState)
        search.add_filter("ticket", ticket)
        state = search.get_sobject()

        # create the state data for this ticket
        if not state:
            state = SObjectFactory.create(TransactionState.SEARCH_TYPE)
            state.set_value("ticket", ticket)
            data = Xml()
            data.create_doc("state")
            state.set_value("data", data.to_string() )
            state.commit()

        return state
开发者ID:0-T-0,项目名称:TACTIC,代码行数:17,代码来源:transaction_state.py

示例3: get

# 需要导入模块: from search import Search [as 别名]
# 或者: from search.Search import add_filter [as 别名]
    def get(cls, user_name=None, namespace=None, time_interval=None):
        search = Search("sthpw/transaction_log")

        if user_name:
            search.add_filter("login", user_name)

        if namespace:
            search.add_filter("namespace", namespace)

        if time_interval and time_interval != 'NONE':
            from sql import Select
            search.add_where(Select.get_interval_where(time_interval))

        search.add_order_by("timestamp desc")
        search.set_limit(100)
        sobjects = search.do_search()
        return sobjects
开发者ID:2gDigitalPost,项目名称:tactic_src,代码行数:19,代码来源:transaction_log.py

示例4: get_next_redo

# 需要导入模块: from search import Search [as 别名]
# 或者: from search.Search import add_filter [as 别名]
    def get_next_redo():
        from pyasm.biz import Project
        namespace = Project.get_project_code()

        user_name = Environment.get_user_name()
        search = Search("sthpw/transaction_log")
        search.add_filter("login", user_name)
        search.add_filter("namespace", namespace)
        
        search.add_filter("type", "redo")
        search.add_order_by("timestamp")
        sobject = search.get_sobject()
        return sobject
开发者ID:2gDigitalPost,项目名称:tactic_src,代码行数:15,代码来源:transaction_log.py

示例5: get_last

# 需要导入模块: from search import Search [as 别名]
# 或者: from search.Search import add_filter [as 别名]
    def get_last(type=None):
        #namespace = SearchType.get_project()
        from pyasm.biz import Project
        namespace = Project.get_project_code()

        user_name = Environment.get_user_name()
        search = Search("sthpw/transaction_log")
        search.add_filter("login", user_name)
        search.add_filter("namespace", namespace)
        if type:
            search.add_filter("type", type)
        search.add_order_by("timestamp desc")
        sobject = search.get_sobject()
        return sobject
开发者ID:2gDigitalPost,项目名称:tactic_src,代码行数:16,代码来源:transaction_log.py


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