Using Django bulk_create objects in foreign keys?

后端 未结 2 1911
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-06 00:48

I was reading up on Django bulk_create and a few of its \"flaws\":

\"
This has a number of caveats though:

1. The model\'s save() method will not be called, and         


        
2条回答
  •  广开言路
    2021-02-06 01:11

    For the first question, no you won't be able to do that, because obj won't have its primary key set so couldn't be used as a foreign key.

    The second question, no that's not what it says at all. It specifically mentions "multi-table inheritance": inheriting from an abstract model is not multi-table inheritance.

提交回复
热议问题