Skip to content

Commit

Permalink
Fix typo in docs (#245)
Browse files Browse the repository at this point in the history
* Fix typo

* Update Changelog
  • Loading branch information
bnjmn committed Oct 25, 2021
1 parent f278865 commit b339c37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added

### Changed
- Fix a simple typo in `bulk_create` disclaimer in docs

### Removed

Expand Down
2 changes: 1 addition & 1 deletion docs/source/basic_usage.rst
Expand Up @@ -218,7 +218,7 @@ It also works with ``prepare``:
The ``make`` method also accepts a parameter ``_bulk_create`` to use Django's `bulk_create <https://docs.djangoproject.com/en/3.0/ref/models/querysets/#bulk-create>`_ method instead of calling ``obj.save()`` for each created instance.

**Disclaimer**: Django's ``bulk_create`` does not updates the created object primary key as explained in their docs. Because of that, there's no way for model-bakery to avoid calling ``save`` method for all the foreign keys.
**Disclaimer**: Django's ``bulk_create`` does not update the created object primary key as explained in their docs. Because of that, there's no way for model-bakery to avoid calling ``save`` method for all the foreign keys.

So, for example, if you're trying to create 20 instances of a model with a foreign key using ``_bulk_create`` this will result in 21 queries (20 for each foreign key object and one to bulk create your 20 instances).

Expand Down

0 comments on commit b339c37

Please sign in to comment.