mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-08 08:38:16 -06:00
Extend documentation & misc cleanup
This commit is contained in:
parent
8a594d0a49
commit
ecb680dd19
@ -74,7 +74,7 @@ If a default value is specified for a selection field, it must exactly match one
|
|||||||
|
|
||||||
An object or multi-object custom field can be used to refer to a particular NetBox object or objects as the "value" for a custom field. These custom fields must define an `object_type`, which determines the type of object to which custom field instances point.
|
An object or multi-object custom field can be used to refer to a particular NetBox object or objects as the "value" for a custom field. These custom fields must define an `object_type`, which determines the type of object to which custom field instances point.
|
||||||
|
|
||||||
By default, an object choice field will make all objects of that type available for selection in the drop-down. The list choices can be filtered to only show objects with certain values by providing a `query_params` dict in the Related Object Filter field, as a JSON value. More information about `query_params` can be found [here](./custom-scripts.md#objectvar)
|
By default, an object choice field will make all objects of that type available for selection in the drop-down. The list choices can be filtered to show only objects with certain values by providing a `query_params` dict in the Related Object Filter field, as a JSON value. More information about `query_params` can be found [here](./custom-scripts.md#objectvar).
|
||||||
|
|
||||||
## Custom Fields in Templates
|
## Custom Fields in Templates
|
||||||
|
|
||||||
|
@ -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.
|
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
|
### 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.)
|
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.)
|
||||||
|
@ -54,7 +54,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{% trans "Related object filter" %}</th>
|
<th scope="row">{% trans "Related object filter" %}</th>
|
||||||
<td>{{ object.related_object_filter }}</td>
|
{% if object.related_object_filter %}
|
||||||
|
<td><pre>{{ object.related_object_filter|json }}</pre></td>
|
||||||
|
{% else %}
|
||||||
|
<td>{{ ''|placeholder }}</td>
|
||||||
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user