Making a multi-table inheritance design generic in Django

前端 未结 2 1865
小鲜肉
小鲜肉 2020-12-19 16:21

First of all, some links to pages I\'ve used for reference: A SO question, and the Django docs on generic relations and multi-table inheritance.

So far, I have a mul

2条回答
  •  醉话见心
    2020-12-19 16:47

    It would be better to compose the models of an Item model and an ItemType model. Subclassing models sounds nice and is useful in a few edge cases, but generally, it is safest and most efficient to stick to tactics that work with your database, rather than against it.

提交回复
热议问题