Is there any best practice in handling "support tables" in Django?
I dislike Field.choices
, as it doesn't really enforce integrity (it doesn't even create check constraints), so I prefer creating a full-blown model (and often, I find myself adding additional fields in the support table).
Now, if I use a full model, I suppose the right way to go is to create an initial data fixture for the table content, but is there a "right way" to have named instances of the row, say...
class State(models.Model):
name = model.TextField()
STATES = dict(
NEW=State.objects.get(pk=0),
IN_PROGRESS=State.objects.get(pk=1),
)
... or something like that.
What do you use?