Hi,
I recently upgraded from Netbox 2.8.8 to 2.11.4, and have been having some issues with export templates. Due to the adjustments with circuit terminations, I have been trying to get the template adjusted to the new cable_peer model but I am not sure what I am doing wrong.
To test, I cut it down to a really simple export template is from DCIM -> Device:
{%- for device in queryset -%}
{%- for interface in device.interfaces.all() %} {#- Begin Interfaces Loop #}
{{
interface.name }},{{ interface.mode.value }},{{ interface.cable.peer.circuit.cid }}
{%- endfor %} {#- End Interfaces Loop #}
{%- endfor %} {#- End of main loop #}
I keep getting errors like the following:
There was an error rendering the selected export template (Interface Listing Test): 'dcim.models.device_components.Interface object' has no attribute 'cable_peer'
It seems I can't access data outside of the interface scope any longer.
Previously, this would have been {{ interface.connected_endpoint.circuit.cid }} and has been working ok for me until this point.
Can anyone point me in the right direction with this?
Thanks!