﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24373	RegexValidator In ArrayField Not Running	David Muller	Marc Tamlyn <marc.tamlyn@…>	"I am trying out Django 1.8's new ArrayField and was hoping to enforce RegexValidation on an array of CharFields.  It appears, however, that the RegexValidator is not being run.

For the sake of simplicity, let's say I only wanted to accept numeric values in my CharFields.  We'll also say that my save() method calls full_clean():

{{{
class TestModel(models.Model):
    names = ArrayField(
        models.CharField(max_length=100, blank=False, validators=[RegexValidator(r'^[0-9]*$')]),
    )

    def save(self, *args, **kwargs):
        """"""
        Raise ValidationError if a field doesn't pass validation.
        """"""
        try:
            self.full_clean()
        except ValidationError:
            raise
        super(TestModel, self).save(*args, **kwargs)
}}}

No ValidationError is thrown, a TestModel record is created successfully:

{{{
In [2]: TestModel.objects.create(names=['no'])
Out[2]: <TestModel: TestModel object>
}}}

Is not possible to add validators to the <base_field> of my ArrayField?

Thanks! "	Uncategorized	closed	contrib.postgres	1.8alpha1	Normal	fixed	ArrayField RegexValidator		Unreviewed	0	0	0	0	0	0
