[Answered ]-Django bulk create for models with multiple required fields

2👍

You can do it like this:

demographic = Demographic.objects.get(id=7)
PersonDemographic.objects.bulk_create(
    [PersonDemographic(person=person, demographic=demographic) for person in Person.objects.some_query_set()]
)

Leave a comment