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


Python Search.add_relationship_filter方法代码示例

本文整理汇总了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()
开发者ID:mincau,项目名称:TACTIC,代码行数:28,代码来源:edit_wdg_action.py

示例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
开发者ID:CeltonMcGrath,项目名称:TACTIC,代码行数:48,代码来源:misc_input_wdg.py


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