Django uses metaclasses to create the actual class based on the class definition you provide. In short, after creating an instance of your model class, the metaclass will go through the definitions of your model field and return the corresponding class with the corresponding attributes.
To answer your question directly, using class variables instead of instance variables ( object.self ) allows the metaclass to validate class attributes without the need for an instance.
For more information, see the source and the following documents:
Shawn chin
source share