[Fixed]-Foreign key relations in django bulk_create query?

5👍

If what you’re trying to do is create instances of Reports alongside the Reportsquery, then no bulk_create() won’t do this. However, if the instances of Reports already exist in the database then you could manually add their pk‘s to the list you pass to bulk_create(). Then the Reportquery instances will be created with the correct relations to Reports.

👤Matt

Leave a comment