class Testsuits(Base): name = db.Column(db.String(200), unique=True, comment="套件名称") # project 外键关联 ??? on_delete=models.CASCADE # project = models.ForeignKey('projects.Projects', on_delete=models.CASCADE, # related_name='testsuits', help_text='所属项目') project_id = db.Column(db.ForeignKey("projects.id"), comment="所属项目") include = db.Column(db.Text, comment='包含的接口')
class Testcases(Base): name = db.Column(db.String(50), unique=True, comment="用例名称") # interfaces 外键关联 ??? on_delete=models.CASCADE # interface = models.ForeignKey('interfaces.Interfaces', on_delete=models.CASCADE, related_name='testcases', # help_text='所属接口') interface_id = db.Column(db.ForeignKey("interfaces.id"), comment="所属接口") include = db.Column(db.String(50), comment='用例执行前置顺序') author = db.Column(db.String(50), comment='编写人员') request = db.Column(db.String(50), comment='请求信息')
class Configures(Base): name = db.Column(db.String(50), comment="配置名称") # interfaces 外键关联 ??? on_delete=models.CASCADE # interface = models.ForeignKey('interfaces.Interfaces', # on_delete=models.CASCADE, # related_name='configures', # help_text='所属接口') interface_id = db.Column(db.ForeignKey("interfaces.id"), comment="所属接口") author = db.Column(db.String(50), comment="编写人员") request = db.Column(db.Text, comment="请求信息")
class Interfaces(Base): name = db.Column(db.String(200), unique=True, comment="接口名称") tester = db.Column(db.String(50), comment="测试人员") # desc = models.CharField('简要描述', max_length=200, null=True, blank=True, help_text='简要描述') desc = db.Column(db.String(200), comment="简要描述") # 外键的形式 '表名.字段' # 外键,必须要是是唯一键,index, ===> 主键 # project = models.ForeignKey('projects.Projects', on_delete=models.CASCADE, # related_name='interfaces', help_text='所属项目') project_id = db.Column(db.ForeignKey("projects.id"), comment="所属项目")
class DebugTalks(Base): name = db.Column(db.String(200), default='debugtalk.py', comment="debugtalk文件名称") debugtalk = db.Column(db.Text, default='#debugtalk.py', comment="debugtalk.py文件") # projects 外键关联 ??? on_delete=models.CASCADE # project = db.OneToOneField('projects.Projects', on_delete=models.CASCADE, # related_name='debugtalks', help_text='所属项目') project_id = db.Column(db.ForeignKey("projects.id"), comment="所属项目")