Creating a cable-export template for v3.4.3 #12018
-
Hi, I would like some help converting a template I used for exporting cables in v2.x.y to something that works in v3.4.3. In the earlier version the below worked ok, but with the changes I can not determine which fileds I need:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I was closer than I thought, this almost works, just need to find the correct call for side_a/b_name to replace
content type: DCIM > Cables Preferably I would like to see this or similar offered by Netbox and supported for future versions. |
Beta Was this translation helpful? Give feedback.
-
Sorry, it is actually this one that is not working |
Beta Was this translation helpful? Give feedback.
-
I finally solved this with the help of #11762 At first I didn't understand why one would assign to the variables, but it does make it simpler. I had another order for the fields, maybe this is helpful to someone:
content type: DCIM > Cables Example output: |
Beta Was this translation helpful? Give feedback.
I finally solved this with the help of #11762
At first I didn't understand why one would assign to the variables, but it does make it simpler. I had another order for the fields, maybe this is helpful to someone:
label,status,type,color,length,length_unit,side_a_device,side_a_type,side_a_name,side_b_device,side_b_type,side_b_name {%- for c in queryset %} {%- set act = c.a_terminations[0].cable_terminations.content_type %} {%- set bct = c.b_terminations[0].cable_terminations.content_type %} {%- if act.app_label != 'circuits' and bct.app_label != 'circuits' %} "{{ c.label }}",{{ c.status }},{{ c.type }},{{ c.color }},{{ c.length|default("", True) }},{{ c.length_unit }},{{ c.a_terminations[0…