Skip to content

Commit 861a52d

Browse files
committed
Closes #5965: Mention cf property on CustomFieldModel in docs
1 parent 9df2130 commit 861a52d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/additional-features/custom-fields.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ Each custom selection field must have at least two choices. These are specified
3939

4040
If a default value is specified for a selection field, it must exactly match one of the provided choices.
4141

42+
## Custom Fields in Templates
43+
44+
Several features within NetBox, such as export templates and webhooks, utilize Jinja2 templating. For convenience, objects which support custom field assignment expose custom field data through the `cf` property. This is a bit cleaner than accessing custom field data through the actual field (`custom_field_data`).
45+
46+
For example, a custom field named `foo123` on the Site model is accessible on an instance as `{{ site.cf.foo123 }}`.
47+
4248
## Custom Fields and the REST API
4349

4450
When retrieving an object via the REST API, all of its custom data will be included within the `custom_fields` attribute. For example, below is the partial output of a site with two custom fields defined:

0 commit comments

Comments
 (0)