forked from kongfp/TP_Admin
31
0
Fork 1

添加默认字段

pull/2/head
lishuang 2 years ago
parent f309d32c5e
commit dca40c7442

@ -149,3 +149,12 @@ CORS_ALLOW_METHODS = (
'PUT',
'VIEW',
)
USE_L10N = False
DATE_FORMAT = 'Y-m-d'
DATETIME_FORMAT = 'Y-m-d H:M:S'
REST_FRAMEWORK = {
'DATETIME_FORMAT': "%Y-%m-%d %H:%M:%S",
'DATE_FORMAT': "%Y-%m-%d",
}

@ -1,6 +1,5 @@
from django.db import models
# Create your models here.
class TP(models.Model):
# uid
@ -26,11 +25,11 @@ class TP(models.Model):
# 分析结果
ai_analysis = models.CharField(max_length=255)
# 加入时间
add_time = models.DateTimeField()
add_time = models.DateTimeField(auto_now_add=True)
# 更新时间
update_time = models.DateTimeField()
update_time = models.DateTimeField(auto_now=True)
# 是否显示
is_display = models.BooleanField()
is_display = models.BooleanField(default=True)

Binary file not shown.
Loading…
Cancel
Save