1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- import datetime
- from django.db import models
- from utils.util_add_id import gen_next_id
- from utils.util_create_file import create_version_file
- class Software(models.Model):
- name = models.CharField(max_length=128, verbose_name='被测试软件名')
- id = models.CharField(max_length=128, unique=True, primary_key=True, verbose_name='被测试软件编号',
- default='TestLaboratory_V1_Software_1')
- type = models.CharField(max_length=20, verbose_name='被测试软件类型')
- report_file = models.TextField(null=True, verbose_name='测试报告id文件')
- create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
- update_time = models.DateTimeField(auto_now=True, verbose_name='修改时间')
- delete = models.BooleanField(default=False)
- def __str__(self):
- return self.name
- class Meta:
- verbose_name = '被测试软件'
- verbose_name_plural = verbose_name
- db_table = 'software'
- class Version(models.Model):
- id = models.CharField(max_length=128, unique=True, primary_key=True, verbose_name='软件版本',
- default='TestLaboratory_V1_Version_1')
- number = models.CharField(max_length=20, verbose_name='版本号')
- software = models.ForeignKey(Software, on_delete=models.CASCADE, verbose_name='所属软件')
- version_file = models.TextField(verbose_name='软件路径id文件')
- create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
- update_time = models.DateTimeField(auto_now=True, verbose_name='修改时间')
- delete = models.BooleanField(default=False)
- def __str__(self):
- return self.software.name + " " + self.number
- class Meta:
- verbose_name = '软件版本'
- verbose_name_plural = verbose_name
- db_table = 'version'
- def create_software(name, software_type, version_num, file):
-
-
-
-
-
- pass
- def get_software(name, software_type, sort):
- pass
- def create_version(software_id, version_num, file):
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- pass
|