Move CUSTOM_VALIDATORS to dynamic configuration

This commit is contained in:
jeremystretch
2021-11-08 15:22:29 -05:00
parent 2a00519b93
commit f8e44c09eb
7 changed files with 38 additions and 33 deletions

View File

@@ -43,6 +43,29 @@ changes in the database indefinitely.
---
## CUSTOM_VALIDATORS
This is a mapping of models to [custom validators](../customization/custom-validation.md) that have been defined locally to enforce custom validation logic. An example is provided below:
```python
CUSTOM_VALIDATORS = {
"dcim.site": [
{
"name": {
"min_length": 5,
"max_length": 30
}
},
"my_plugin.validators.Validator1"
],
"dim.device": [
"my_plugin.validators.Validator1"
]
}
```
---
## ENFORCE_GLOBAL_UNIQUE
Default: False

View File

@@ -49,22 +49,6 @@ CORS_ORIGIN_WHITELIST = [
---
## CUSTOM_VALIDATORS
This is a mapping of models to [custom validators](../customization/custom-validation.md) that have been defined locally to enforce custom validation logic. An example is provided below:
```python
CUSTOM_VALIDATORS = {
'dcim.site': (
Validator1,
Validator2,
Validator3
)
}
```
---
## DEBUG
Default: False