1
0
mirror of https://github.com/django/django.git synced 2025-10-29 08:36:09 +00:00

Fixed #33799, Refs #31685 -- Added parameters for updating conflicts to QuerySeta.abulk_create().

This commit is contained in:
DhruvaPatil98
2022-06-23 12:32:41 +05:30
committed by Mariusz Felisiak
parent e6f36ea0a9
commit c627226d05
2 changed files with 29 additions and 2 deletions

View File

@@ -834,11 +834,22 @@ class QuerySet:
return objs
async def abulk_create(self, objs, batch_size=None, ignore_conflicts=False):
async def abulk_create(
self,
objs,
batch_size=None,
ignore_conflicts=False,
update_conflicts=False,
update_fields=None,
unique_fields=None,
):
return await sync_to_async(self.bulk_create)(
objs=objs,
batch_size=batch_size,
ignore_conflicts=ignore_conflicts,
update_conflicts=update_conflicts,
update_fields=update_fields,
unique_fields=unique_fields,
)
def bulk_update(self, objs, fields, batch_size=None):