当前位置: 首页>>代码示例>>Python>>正文


Python Release.is_valid_version方法代码示例

本文整理汇总了Python中sentry.models.Release.is_valid_version方法的典型用法代码示例。如果您正苦于以下问题:Python Release.is_valid_version方法的具体用法?Python Release.is_valid_version怎么用?Python Release.is_valid_version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sentry.models.Release的用法示例。


在下文中一共展示了Release.is_valid_version方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: finish_release

# 需要导入模块: from sentry.models import Release [as 别名]
# 或者: from sentry.models.Release import is_valid_version [as 别名]
    def finish_release(self, version, **values):
        if not Release.is_valid_version(version):
            raise HookValidationError('Invalid release version: %s' % version)

        values.setdefault('date_released', timezone.now())
        try:
            with transaction.atomic():
                release = Release.objects.create(
                    version=version, organization_id=self.project.organization_id, **values
                )
        except IntegrityError:
            release = Release.objects.get(
                version=version,
                organization_id=self.project.organization_id,
            )
            release.update(**values)

        release.add_project(self.project)

        Activity.objects.create(
            type=Activity.RELEASE,
            project=self.project,
            ident=Activity.get_version_ident(version),
            data={'version': version},
            datetime=values['date_released'],
        )
        self.set_refs(release=release, **values)
开发者ID:Kayle009,项目名称:sentry,代码行数:29,代码来源:releasehook.py

示例2: start_release

# 需要导入模块: from sentry.models import Release [as 别名]
# 或者: from sentry.models.Release import is_valid_version [as 别名]
    def start_release(self, version, **values):
        if not Release.is_valid_version(version):
            raise HookValidationError('Invalid release version: %s' % version)

        try:
            with transaction.atomic():
                release = Release.objects.create(
                    version=version, organization_id=self.project.organization_id, **values
                )
        except IntegrityError:
            release = Release.objects.get(
                version=version,
                organization_id=self.project.organization_id,
            )
            release.update(**values)

        release.add_project(self.project)
开发者ID:Kayle009,项目名称:sentry,代码行数:19,代码来源:releasehook.py

示例3: set_commits

# 需要导入模块: from sentry.models import Release [as 别名]
# 或者: from sentry.models.Release import is_valid_version [as 别名]
    def set_commits(self, version, commit_list):
        """
        Commits should be ordered oldest to newest.

        Calling this method will remove all existing commit history.
        """
        if not Release.is_valid_version(version):
            raise HookValidationError('Invalid release version: %s' % version)

        project = self.project
        try:
            with transaction.atomic():
                release = Release.objects.create(
                    organization_id=project.organization_id, version=version
                )
        except IntegrityError:
            release = Release.objects.get(organization_id=project.organization_id, version=version)
        release.add_project(project)

        release.set_commits(commit_list)
开发者ID:Kayle009,项目名称:sentry,代码行数:22,代码来源:releasehook.py

示例4: validate_version

# 需要导入模块: from sentry.models import Release [as 别名]
# 或者: from sentry.models.Release import is_valid_version [as 别名]
 def validate_version(self, attrs, source):
     value = attrs[source]
     if not Release.is_valid_version(value):
         raise serializers.ValidationError('Invalid value for release')
     return attrs
开发者ID:Kayle009,项目名称:sentry,代码行数:7,代码来源:project_releases.py

示例5: validate_version

# 需要导入模块: from sentry.models import Release [as 别名]
# 或者: from sentry.models.Release import is_valid_version [as 别名]
 def validate_version(self, attrs, source):
     value = attrs[source]
     if not Release.is_valid_version(value):
         raise serializers.ValidationError('Release with name %s is not allowed' % value)
     return attrs
开发者ID:getsentry,项目名称:sentry,代码行数:7,代码来源:release.py


注:本文中的sentry.models.Release.is_valid_version方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。