models.py 952 B

12345678910111213141516171819202122232425
  1. from django.db import models
  2. # Create your models here.
  3. from apps.user.models import User
  4. class Group(models.Model):
  5. name = models.CharField(max_length=128, verbose_name='组名')
  6. id = models.CharField(max_length=128, unique=True, primary_key=True, verbose_name='分组id',
  7. default='TestLaboratory_V1_Group_1')
  8. code = models.CharField(max_length=12, verbose_name='分组code')
  9. manager = models.CharField(max_length=60, verbose_name='管理员id')
  10. users = models.ManyToManyField(User, verbose_name='成员')
  11. create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
  12. update_time = models.DateTimeField(auto_now=True, verbose_name='修改时间')
  13. delete = models.BooleanField(default=False)
  14. def __str__(self):
  15. return self.name
  16. class Meta:
  17. verbose_name = '被测试软件'
  18. verbose_name_plural = verbose_name
  19. db_table = 'group'