I've got a situation where I have one base Django model Rolls
, mapped to the table rolls
. There are multiple types of rolls, controlled by a column called type
. In the older codebase I'm writing a v2 for (used to be PHP), I created subclasses for each type, that controlled setting their own type
value, and it worked fine. I can't figure out how to set this up in Django.
I'd like them all to use the same table, and each will derive methods from the base model, but have different implementations for many of those methods. I figure I can write a manager to handle getting back the right values, but I can't figure out how to setup the models.
I tried setting a single base model and then derived other models from it, but those created different tables for each of them. Using managed = False
seems the wrong way to go, given the subclasses don't represent tables of their own.