本文整理汇总了Python中search.Search.get_sobject方法的典型用法代码示例。如果您正苦于以下问题:Python Search.get_sobject方法的具体用法?Python Search.get_sobject怎么用?Python Search.get_sobject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类search.Search
的用法示例。
在下文中一共展示了Search.get_sobject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_next_redo
# 需要导入模块: from search import Search [as 别名]
# 或者: from search.Search import get_sobject [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
示例2: get_last
# 需要导入模块: from search import Search [as 别名]
# 或者: from search.Search import get_sobject [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
示例3: get_by_ticket
# 需要导入模块: from search import Search [as 别名]
# 或者: from search.Search import get_sobject [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