mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
Changelog for #5963
This commit is contained in:
parent
9839885198
commit
569041a4c4
@ -2,6 +2,31 @@
|
|||||||
|
|
||||||
## v3.0-beta1 (FUTURE)
|
## v3.0-beta1 (FUTURE)
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
#### Custom Model Validation ([#5963](https://github.com/netbox-community/netbox/issues/5963))
|
||||||
|
|
||||||
|
This release introduces the [`CUSTOM_VALIDATORS`](../configuration/optional-settings.md#custom_validators) configuration parameter, which allows administrators to map NetBox models to custom validator classes to enforce custom validation logic. For example, the following configuration requires every site to have a name of at least ten characters and a description:
|
||||||
|
|
||||||
|
```python
|
||||||
|
from extras.validators import CustomValidator
|
||||||
|
|
||||||
|
CUSTOM_VALIDATORS = {
|
||||||
|
'dcim.site': (
|
||||||
|
CustomValidator({
|
||||||
|
'name': {
|
||||||
|
'min_length': 10,
|
||||||
|
},
|
||||||
|
'description': {
|
||||||
|
'required': True,
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
CustomValidator can also be subclassed to enforce more complex logic by overriding its `validate()` method. See the [custom validation](../additional-features/custom-validation.md) documentation for more details.
|
||||||
|
|
||||||
### Enhancements
|
### Enhancements
|
||||||
|
|
||||||
* [#2434](https://github.com/netbox-community/netbox/issues/2434) - Add option to assign IP address upon creating a new interface
|
* [#2434](https://github.com/netbox-community/netbox/issues/2434) - Add option to assign IP address upon creating a new interface
|
||||||
|
Loading…
Reference in New Issue
Block a user