修改了部门详情的model,

添加了对数据库数据输出前的格式验证
This commit is contained in:
康家辉
2022-04-30 22:37:50 +08:00
parent 14a75d3fdd
commit 19440fe0e2
5 changed files with 104 additions and 143 deletions
+3 -5
View File
@@ -6,15 +6,14 @@ class Department(models.Model):
did = models.IntegerField("部门ID")
department = models.CharField("部门", max_length=10) # 如“程序部”
department_en = models.CharField("部门英文名称", max_length=30) # 如“程序部”
part = models.IntegerField("部分", default=0) # 0:内容一;1:内容二 (可能没必要)
title = models.CharField("标题", max_length=30) # 如部门介绍/部门要求
content = models.CharField("内容", max_length=1500) # 如部门介绍/部门要求
content = models.CharField("内容", max_length=800) # 如部门介绍/部门要求
introduction = models.CharField("介绍", max_length=800) # 如部门介绍/部门要求
class Meta:
db_table = 'it_Department'
verbose_name_plural = u'部门详情'
class History(models.Model):
grade = models.IntegerField("年级")
did = models.IntegerField("部门ID")
@@ -27,7 +26,6 @@ class History(models.Model):
class Members(models.Model):
# 默认id作为成员id
id = models.IntegerField(primary_key=True)
avatar = models.ImageField("头像", upload_to="avatar", blank=True)
did = models.IntegerField("所属部门ID", default=0)
grade = models.IntegerField("年级")