models.py 882 B

123456789101112131415161718192021222324
  1. from django.db import models
  2. # Create your models here.
  3. class FileManager(models.Model):
  4. id = models.CharField(max_length=128, unique=True, verbose_name='文件id', primary_key=True,
  5. default='TestLaboratory_V1_File_1')
  6. path = models.FilePathField(max_length=200, verbose_name='文件路径')
  7. create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
  8. update_time = models.DateTimeField(auto_now=True, verbose_name='修改时间')
  9. delete = models.BooleanField(default=False)
  10. # category: software, report, plan_statement, task_statement, case_file
  11. category = models.CharField(max_length=20, verbose_name='文件类型')
  12. def __str__(self):
  13. return self.path
  14. class Meta:
  15. verbose_name = '文件管理'
  16. verbose_name_plural = verbose_name
  17. db_table = 'file_manager'