Jinja2 export template generates incorrectly value 'core.ObjectType.None' of field object_types on extras.custom-fields model #10323

Closed
opened 2025-12-29 21:29:58 +01:00 by adam · 0 comments
Owner

Originally created by @marcusyuri on GitHub (Oct 4, 2024).

Deployment Type

Self-hosted

NetBox Version

v4.1.3

Python Version

3.10

Steps to Reproduce

  1. Create a custom field and assign to an object type. Ex: my_custom_field assigned to dcim.interface
    image

  2. Create a Jinja2 export template on Custom Field matching field object_types

{% for field in queryset %}
name: {{ field.name }}
object_types: {{ field.object_types }}
{% endfor %}
  1. Export the custom field using the export template
    image

Expected Behavior

The object_types field replaced by the assigned object type. In the example, it was expected:

object_types: dcim.interface

Observed Behavior

object_types: core.ObjectType.None

Originally created by @marcusyuri on GitHub (Oct 4, 2024). ### Deployment Type Self-hosted ### NetBox Version v4.1.3 ### Python Version 3.10 ### Steps to Reproduce 1. Create a custom field and assign to an object type. Ex: my_custom_field assigned to dcim.interface ![image](https://github.com/user-attachments/assets/820e5499-b3b6-4492-8927-4de7d408eb94) 3. Create a Jinja2 export template on Custom Field matching field object_types ``` {% for field in queryset %} name: {{ field.name }} object_types: {{ field.object_types }} {% endfor %} ``` 5. Export the custom field using the export template ![image](https://github.com/user-attachments/assets/29ff97e9-7cdf-4655-a95c-41e82a9750e5) ### Expected Behavior The object_types field replaced by the assigned object type. In the example, it was expected: object_types: dcim.interface ### Observed Behavior object_types: core.ObjectType.None
adam closed this issue 2025-12-29 21:29:58 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10323