mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-31 21:06:25 -06:00
Update data-validation.md
Revised after suggestion by jeremystretch
This commit is contained in:
parent
5459b37362
commit
ec46044d18
@ -96,7 +96,7 @@ The following colors are supported:
|
||||
|
||||
This is a mapping of models to [custom validators](../customization/custom-validation.md) against which an object is evaluated immediately prior to its deletion. If validation fails, the object is not deleted. An example is provided below:
|
||||
|
||||
**Example prevents the deletion of a site entry:**
|
||||
Example prevents the deletion of a site entry:
|
||||
```python
|
||||
PROTECTION_RULES = {
|
||||
"dcim.site": [
|
||||
@ -111,14 +111,9 @@ PROTECTION_RULES = {
|
||||
```
|
||||
|
||||
### Configuration via Web UI
|
||||
Example prevents the deletion of a device entry:
|
||||
|
||||

|
||||
|
||||
**Path:**
|
||||
- WebUI (v3.x.x) --> Admin --> Configuration Config Revisions --> Add (or Edit last Config)
|
||||
- WebUI (v4.0.0) --> Admin --> Configuration History --> Add (or Edit last Config)
|
||||
|
||||
**Example prevents the deletion of a device entry:**
|
||||
```python
|
||||
{
|
||||
"dcim.device": [
|
||||
@ -131,7 +126,7 @@ PROTECTION_RULES = {
|
||||
}
|
||||
```
|
||||
|
||||
If you navigate to a device, rack or site, you will find the path in the top right-hand corner.
|
||||
If you navigate to a device, rack or site, you will find the path in the top right-hand corner:
|
||||
|
||||

|
||||
|
||||
@ -139,4 +134,3 @@ Examples:
|
||||
- dcim.device
|
||||
- dcim.site
|
||||
- dcim.rack
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user