The tutorial on the django website shows this code for the models:
from django.db import models class Poll(models.Model): question = models.CharField(ma
Have a look at the Model class under django/db/models.py. There the class attributes are turned to instance attributes via something like
Model
setattr(self, field.attname, val)
One might recommend the whole file (ModelBase and Model class) as an excellent hands-on example on metaclasses.
ModelBase