1 2 3 4 5 6 7 8 9 10 11
|
from django.db import models
class BaseModel(models.Model): created_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') updated_time = models.DateTimeField(auto_now=True, verbose_name='最后更新时间') is_delete = models.BooleanField(default=False, verbose_name='是否删除') is_show = models.BooleanField(default=True, verbose_name='是否上架') orders = models.IntegerField(verbose_name='优先级') # 参考字段
phone = models.ForeignKey("Teacher", related_name='teacher_bind', on_delete=models.CASCADE, verbose_name="手机号",null=True,db_constraint=False)
classMeta: abstract = True
|