Public models: utils/models.py
from django.db import models# Create public field modelclass CommonModel(models.Model):is_valid = models.BooleanField('is it valid', default=True)create_at = models.DateTimeField('create time', auto_now_add=True)updated_at = models.DateTimeField('modified time', auto_now=True)class Meta:# No need to create new database tableabstract = True
After the subclass model is inherited, there is an error message:
How is the model variable defined?