Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use bulk_create when creating batches in Django #764

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

OskarPersson
Copy link

No description provided.

@OskarPersson
Copy link
Author

This fails if the model has a non-nullable related field and a relies on a subfactory creating the related objects. I'm not sure if I can easily create all related objects directly and only bulk_create the root objects?

@MRigal
Copy link
Contributor

MRigal commented Nov 2, 2020

@OskarPersson you might add a failing test with xfail to illustrate the issue. What about checking for these objects and adding them in the bulk list, sorted so that they are created first?

@kingbuzzman
Copy link
Contributor

kingbuzzman commented Jul 18, 2022

I started a more advanced version of this over at #925

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants