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


Python Pool.create_from_records方法代码示例

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


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

示例1: write

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import create_from_records [as 别名]
 def write(cls, products, values, *args):
     """Create a record in elastic search on write
     """
     IndexBacklog = Pool().get('elasticsearch.index_backlog')
     rv = super(Product, cls).write(products, values, *args)
     IndexBacklog.create_from_records(products)
     return rv
开发者ID:fulfilio,项目名称:trytond-product-elastic-search,代码行数:9,代码来源:product.py

示例2: create

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import create_from_records [as 别名]
    def create(cls, vlist):
        """Create a record in elastic search on create
        :param vlist: List of dictionaries of fields with values
        """
        IndexBacklog = Pool().get('elasticsearch.index_backlog')

        products = super(Product, cls).create(vlist)
        IndexBacklog.create_from_records(products)
        return products
开发者ID:fulfilio,项目名称:trytond-product-elastic-search,代码行数:11,代码来源:product.py

示例3: write

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import create_from_records [as 别名]
    def write(cls, templates, values, *args):
        """
        Create a record in elastic search on write
        """
        IndexBacklog = Pool().get('elasticsearch.index_backlog')
        Product = Pool().get('product.product')

        rv = super(Template, cls).write(templates, values, *args)

        products = []
        for template in templates:
            products.extend([Product(p) for p in template.products])
        IndexBacklog.create_from_records(products)
        return rv
开发者ID:fulfilio,项目名称:nereid-webshop-elastic-search,代码行数:16,代码来源:product.py

示例4: create

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import create_from_records [as 别名]
    def create(cls, vlist):
        """
        Create a record in elastic search on create
        :param vlist: List of dictionaries of fields with values
        """
        IndexBacklog = Pool().get('elasticsearch.index_backlog')
        Product = Pool().get('product.product')

        templates = super(Template, cls).create(vlist)
        products = []
        for template in templates:
            products.extend([Product(p) for p in template.products])
        IndexBacklog.create_from_records(products)
        return templates
开发者ID:fulfilio,项目名称:nereid-webshop-elastic-search,代码行数:16,代码来源:product.py

示例5: _trigger_handler

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import create_from_records [as 别名]
    def _trigger_handler(cls, records, trigger):
        "Handler called by trigger"
        IndexBacklog = Pool().get('elasticsearch.index_backlog')

        return IndexBacklog.create_from_records(records)
开发者ID:fulfilio,项目名称:trytond-elastic-search,代码行数:7,代码来源:index.py


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