示例#1
0
class EnvInfo(BaseTable):
    class Meta:
        verbose_name = '环境管理'
        db_table = 'EnvInfo'

    env_name = models.CharField(max_length=40, null=False, unique=True)
    base_url = models.CharField(max_length=40, null=False)
    simple_desc = models.CharField(max_length=50, null=False)
    objects = EnvInfoManager()
示例#2
0
class EnvInfo(BaseTable):
    class Meta:
        verbose_name = '环境管理'
        db_table = 'EnvInfo'

    env_name = models.CharField(max_length=40)
    base_url = models.CharField(max_length=40)
    simple_desc = models.CharField(max_length=50)
    objects = EnvInfoManager()
示例#3
0
class EnvInfo(BaseTable):
    create_time = models.DateTimeField('创建时间',
                                       blank=True,
                                       default=timezone.now)

    class Meta:
        verbose_name = '环境信息'
        db_table = 'env_info'

    env_name = models.CharField('环境名称', max_length=50)
    host_port = models.CharField('请求地址', max_length=50)
    desc = models.CharField('简要描述', max_length=100)
    belong_project = models.ForeignKey(ProjectInfo, on_delete=models.CASCADE)
    is_delete = models.BooleanField('是否已被删除', default=False)

    objects = EnvInfoManager()

    def delete(self, *args, **kwargs):
        self.is_delete = True
        super(EnvInfo, self).save(args, kwargs)

    def __str__(self):
        return self.env_name