Commit 8bac5d1d authored by 王英豪's avatar 王英豪

修改新增

parent b73fd0bb
......@@ -11,7 +11,7 @@ class TestingProgress(models.Model):
duration = models.TextField("测试内容-标题", default="", max_length=1000, null=True)
group = models.IntegerField("是否分组", default=1) # 1 是 0 不是
parent = models.IntegerField("父id", null=True, default=0)
type = models.CharField("图表颜色", max_length=50, null=False)
type = models.CharField("图表颜色", max_length=50, null=True)
description = models.TextField("描述", default="", max_length=20000, null=True)
testing_progress = models.CharField("测试进度", max_length=300, null=True)
update_time = models.DateTimeField(auto_now_add=True)
......
......@@ -12,8 +12,8 @@ import datetime
import time
import os
import logging
logger = logging.getLogger('django')
logger = logging.getLogger('django')
class PersonnelAllocationView(View):
......@@ -31,32 +31,24 @@ class PersonnelAllocationView(View):
logger.info('222222222222')
logger.info(ENV_PROFILE)
logger.info('222222222222')
try:
if 'color' in data.keys():
TestingProgress.objects.create(testing_progress_title=data['text'],
start_date=data['start_date'],
end_date=data['end_date'],
duration=data['duration'],
group=data['group'],
parent=data['parent'],
testing_progress=data['progress'],
type=data['color'],
description=data['description'])
else:
TestingProgress.objects.create(testing_progress_title=data['text'],
group=data['group'],
parent=data['parent'],
testing_progress='',
type='',
description='')
except Exception as e:
logger.info('33333333')
print(e)
logger.info('33333333')
pass
if 'color' in data.keys():
TestingProgress.objects.create(testing_progress_title=data['text'],
start_date=data['start_date'],
end_date=data['end_date'],
duration=data['duration'],
group=data['group'],
parent=data['parent'],
testing_progress=data['progress'],
type=data['color'],
description=data['description'])
else:
TestingProgress.objects.create(testing_progress_title=data['text'],
group=data['group'],
parent=data['parent'],
testing_progress='',
type='',
description='')
return response_success("创建成功")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment