Fixes #16782: Add object filtering for custom fields (#16994)

* Fixes #16782: Add object filtering for custom fields

* Add validation for related_object_filter

* Extend documentation & misc cleanup

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
samk-acw
2024-07-30 05:45:48 +10:00
committed by GitHub
parent a12fdd6e2d
commit 650898719e
8 changed files with 60 additions and 4 deletions

View File

@@ -42,6 +42,13 @@ The type of data this field holds. This must be one of the following:
For object and multiple-object fields only. Designates the type of NetBox object being referenced.
### Related Object Filter
For object and multi-object custom fields, a filter may be defined to limit the available objects when populating a field value. This filter maps object attributes to values. For example, `{"status": "active"}` will include only objects with a status of "active."
!!! warning
This setting is employed for convenience only, and should not be relied upon to enforce data integrity.
### Weight
A numeric weight used to override alphabetic ordering of fields by name. Custom fields with a lower weight will be listed before those with a higher weight. (Note that weight applies within the context of a custom field group, if defined.)