📅  最后修改于: 2022-03-11 14:47:15.648000             🧑  作者: Mango
# Use `MyModel.my_many_to_many.through.objects`
# "Tag.photos.through" => Model with 3 fields [ id, photo, tag ]
photo_tag_1 = Tag.photos.through(photo_id=1, tag_id=1)
photo_tag_2 = Tag.photos.through(photo_id=1, tag_id=2)
Tag.photos.through.objects.bulk_insert([photo_tag_1, photo_tag_2, ...])