factory_boy icon indicating copy to clipboard operation
factory_boy copied to clipboard

Override the DjangoModelFactory's create_batch to use create_bulk

Open thedrow opened this issue 11 years ago • 5 comments

thedrow avatar Nov 10 '13 09:11 thedrow

Yes, this would be a great idea.

A pull request or implementation draft would be quite appreciated :)

rbarrois avatar Nov 14 '13 22:11 rbarrois

mm, does create_batch not actually save to database right now? (new to factory_boy here)

deeTEEcee avatar Feb 01 '16 07:02 deeTEEcee

@deeTEEcee It does but it creates the database rows one by one.

thedrow avatar Feb 01 '16 08:02 thedrow

oh, i see... for some reason, it didn't work for me and i had to loop through the returned objects and call save on them.

deeTEEcee avatar Feb 01 '16 08:02 deeTEEcee

After 8 years, 6 months, and 2 days, there's a PR to address this. It's still a work in progress, and I would appreciate feedback.

kingbuzzman avatar May 12 '22 15:05 kingbuzzman