本文整理汇总了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()
示例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
示例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
示例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
示例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