跳转到主要内容

django bulk_create() 函数

项目描述

安装

$ pip install django-bulk_create

功能

  • 多模型聚合器

示例

from django_bulk_create import bulk_create
from apps.app.models import Model1, Model2

create_list = []
create_list+=[Model1(id=42,description='description')]
create_list+=[Model2(key="value")]

model2kwargs = {
    Model1: dict(
        update_conflicts=True,
        unique_fields = ['id'],
        update_fields = [
            'description',
        ]
    ),
    Model2: dict(ignore_conflicts=True)
}
bulk_create(create_list,model2kwargs)

项目详情


下载文件

为您的平台下载文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

django-bulk_create-1.0.0.tar.gz (1.5 kB 查看哈希)

上传时间:

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面