If I've got a models.py like
class WidgetType(models.Model): name = models.CharField(max_length=200) class Widget(models.Model): typeid = models.ForeignKey(WidgetType) data = models.CharField(max_length=200)
How do i build in some built-in constant values for
WidgetType after i know I am only going to possess a certain couple of kinds of widget? Clearly I possibly could turn on my admin interface and add them manually, but Let me simplify configuration by getting it included in the python.
You could utilize fittings:
As it happens, fittings aren't area of the models, or any python code for your matter. If it ought to be inside your python code, you can listen for that [cde] signal and place your computer data with the ORM, e.g.: