-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update data-validation.md #16183
Update data-validation.md #16183
Changes from all commits
062295d
5459b37
ec46044
a4e22ab
c769ee9
3b02d03
7d54045
6e54e9f
7088791
0ac87ff
29405d2
771ac8a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,6 +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: | ||
```python | ||
PROTECTION_RULES = { | ||
"dcim.site": [ | ||
|
@@ -108,3 +109,28 @@ PROTECTION_RULES = { | |
] | ||
} | ||
``` | ||
|
||
### Configuration via Web UI | ||
Example prevents the deletion of a device entry: | ||
|
||
```python | ||
{ | ||
"dcim.device": [ | ||
{ | ||
"status": { | ||
"eq": "decommissioning" | ||
} | ||
} | ||
] | ||
} | ||
Comment on lines
+114
to
+125
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is essentially a duplication of the example above, and is not needed. |
||
``` | ||
[![NetBox UI](./media/screenshots/Configuration-History-Protection-rules-Example.png)](./media/screenshots/Configuration-History-Protection-rules-Example.png) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both of your images are broken. Please be sure to render the documentation locally with |
||
|
||
If you navigate to a device, rack or site, you will find the path in the top right-hand corner: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't need to be a screenshot; it can just be an embedded tip. |
||
|
||
[![NetBox UI](./media/screenshots/Device-Type-Path-Example.png)](./media/screenshots/Device-Type-Path-Example.png) | ||
|
||
Examples: | ||
- dcim.device | ||
- dcim.site | ||
- dcim.rack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is not needed. The above text references the example.