Skip to main content

django bulk_create() function

Project description

Installation

$ pip install django-bulk_create

Features

  • multiple models aggregator

Examples

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-bulk_create-1.0.0.tar.gz (1.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page