code: def _chunked_bulk_create(django_model_object, unsaved_models, chunk_size=None):
      '''Create new models using bulk_create in batches of `chunk_size`.
      This is designed to overcome a query size limitation in some databases'''
      if chunk_size is None:
          chunk_size = getattr(settings, 'BULK_CREATE_CHUNK_SIZE', 50)
      for i in range(0, len(unsaved_models), chunk_size):
          try:
              django_model_object.objects.bulk_create(unsaved_models[i:i + chunk_size])
          except Exception as e:
              chunk_data = unsaved_models[i:i + chunk_size]
              e.petl_chunk_data = chunk_data
              raise f _chunked_bulk_create(django_model_object, unsaved_models, chunk_size=None):
      '''Create new models using bulk_create in batches of `chunk_size`.
      This is designed to overcome a query size limitation in some databases'''
      if chunk_size is None:
          chunk_size = getattr(settings, 'BULK_CREATE_CHUNK_SIZE', 50)
      for i in range(0, len(unsaved_models), chunk_size):
          try:
              django_model_object.objects.bulk_create(unsaved_models[i:i + chunk_size])
          except Exception as e:
              chunk_data = unsaved_models[i:i + chunk_size]
              e.petl_chunk_data = chunk_data
              raise e
docs: Create new models using bulk_create in batches of `chunk_size`.
      This is designed to overcome a query size limitation in some databases