Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • But most developers said using multi-table inheritance is a bad thing. But why they add this as model inheritance, if this is bad? Commented Feb 9, 2013 at 12:02
  • 1
    You really need a use case before you can say whether its a good or bad solution. As you rightly point out, the django developers wouldn't have taken the time to implement it if it wasn't ever useful. Commented Feb 9, 2013 at 12:51
  • I would say it can be bad. Don't use multi-table inheritance unless you have a specific reason to do so. Don't think of them as "parent classes" and use them as freely as you would normal object oriented inheritance. One reason is that queries will have extra joins and be slower. Another reason is that it increases the "magic factor", and your models won't actually be stored in a single table like one might expect so database-level operations can become more challenging, and third party tools like south can get confused. And never go more than 1x deep if you do use them. Commented Jul 11, 2013 at 21:55