1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Clean up CustomField regex validation

This commit is contained in:
Jeremy Stretch
2020-11-10 10:21:18 -05:00
parent b8a7870750
commit 3d6bf1e0f8
2 changed files with 14 additions and 3 deletions

View File

@ -70,7 +70,8 @@ class CustomField(models.Model):
)
name = models.CharField(
max_length=50,
unique=True
unique=True,
help_text='Internal field name'
)
label = models.CharField(
max_length=50,
@ -120,7 +121,8 @@ class CustomField(models.Model):
validators=[validate_regex],
max_length=500,
verbose_name='Validation regex',
help_text='Regular expression to enforce on text field values'
help_text='Regular expression to enforce on text field values. Use ^ and $ to force matching of entire string. '
'For example, <code>^[A-Z]{3}$</code> will limit values to exactly three uppercase letters.'
)
choices = ArrayField(
base_field=models.CharField(max_length=100),