03.增加抽象基类
# 1.syl/utils/MyBaseModel.py
增加抽象基类
from django.db import models
class Base(models.Model):
create_time = models.DateTimeField('创建时间', auto_now_add=True, null=True)
update_time = models.DateTimeField('更新时间', auto_now=True, null=True)
class Meta:
abstract = True
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
上次更新: 2024/3/13 15:35:10