How to use the productmd.common.RELEASE_VERSION_RE.pattern function in productmd

To help you get started, we’ve selected a few productmd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github product-definition-center / product-definition-center / pdc / apps / release / models.py View on Github external
def _parent_allowed_push_targets(self):
        return self.product.allowed_push_targets


@receiver(pre_save, sender=ProductVersion)
def populate_product_version_id(sender, instance, **kwargs):
    instance.product_version_id = instance.get_product_version_id()


class Release(AllowedPushTargetsModel):
    # release_id is populated by populate_release_id() pre_save hook
    release_id          = models.CharField(max_length=200, blank=False, unique=True)
    short = models.CharField(max_length=200, blank=False, validators=[
        RegexValidator(regex=RELEASE_SHORT_RE.pattern, message='Only accept lowercase letters, numbers or -')])
    version             = models.CharField(max_length=200, blank=False, validators=[
        RegexValidator(regex=RELEASE_VERSION_RE.pattern, message='Only accept comma separated numbers or any text')])
    name                = models.CharField(max_length=255, blank=False)
    release_type        = models.ForeignKey(ReleaseType, blank=False, db_index=True, on_delete=models.CASCADE)
    base_product        = models.ForeignKey(BaseProduct, null=True, blank=True, on_delete=models.CASCADE)
    active              = models.BooleanField(default=True)
    product_version     = models.ForeignKey(ProductVersion, blank=True, null=True, on_delete=models.CASCADE)
    integrated_with     = models.ForeignKey('self',
                                            null=True,
                                            blank=True,
                                            related_name='integrated_releases',
                                            on_delete=models.CASCADE)

    sigkey              = models.ForeignKey(SigKey, blank=True, null=True)
    allow_buildroot_push = models.BooleanField(default=False)
    allowed_debuginfo_services  = models.ManyToManyField(Service, blank=True)

    class Meta: