0

What is the rationale behind the decision to not support Single Table Inheritance in Django?

Is STI a bad design? Does it result in poor performance? Would it conflict with the Django ORM as it is?

Just wondering because it's been a missing feature for like ten years now and so there must have been a conscious decision made that it would never be supported.

rauff
  • 173
  • 4
  • 10

1 Answers1

0

One reason is possibly that Django does not (currently) have the ability to modify database tables after creation.

You can 'kind-of' do STI using proxy models. This will not allow you to have different fields on the different models, but it will allow you to attach different behaviour (via model methods) to different subclasses.

However, if you decide to create a subclass with extra fields, Django will not be able to update the database to reflect that.

Matthew Schinckel
  • 35,041
  • 6
  • 86
  • 121