本文整理汇总了Python中pyasm.search.Search.add_relationship_filter方法的典型用法代码示例。如果您正苦于以下问题:Python Search.add_relationship_filter方法的具体用法?Python Search.add_relationship_filter怎么用?Python Search.add_relationship_filter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.search.Search
的用法示例。
在下文中一共展示了Search.add_relationship_filter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: postprocess
# 需要导入模块: from pyasm.search import Search [as 别名]
# 或者: from pyasm.search.Search import add_relationship_filter [as 别名]
def postprocess(self):
search_type = self.get_option("search_type")
column = self.get_option("column")
search_type = "construction/login_in_trade"
column = "trade_code"
value = self.get_value(self.name)
sobject = self.sobject
search = Search(search_type)
search.add_relationship_filter(sobject)
related = search.get_sobject()
if not related:
related = SearchType.create(search_type)
related.set_parent(sobject)
if not value:
related.delete()
else:
related.set_value(column, value)
related.commit()
示例2: get_display
# 需要导入模块: from pyasm.search import Search [as 别名]
# 或者: from pyasm.search.Search import add_relationship_filter [as 别名]
def get_display(my):
return ''
search_types = 'MMS/discipline.MMS/product_type'.split(".")
top = DivWdg()
parents = None
for search_type in search_types:
if not parents:
search = Search(search_type)
sobjects = search.get_sobjects()
columns = search.get_columns()
column = columns[1]
select = SelectWdg(search_type)
select.set_option("values", [x.get_id() for x in sobjects] )
select.set_option("labels", [x.get_value(column) for x in sobjects] )
top.add(select)
else:
for parent in parents:
search = Search(search_type)
search.add_relationship_filter(parent)
sobjects = search.get_sobjects()
if not sobjects:
continue
columns = search.get_columns()
column = columns[1]
values = [x.get_id() for x in sobjects]
labels = [x.get_value(column) for x in sobjects]
select = SelectWdg(search_type)
select.add_attr("spt_input_key", parent.get_id() )
select.set_option("values", values )
select.set_option("labels", labels )
top.add(select)
parents = sobjects
return top