Need more information extras/export templates #722

Closed
opened 2025-12-29 16:25:06 +01:00 by adam · 1 comment
Owner

Originally created by @Sarkaniok on GitHub (Feb 22, 2017).

  1. This example below creates only *.txt file :
    {% for d in queryset %}{% if d.status and d.primary_ip %}define host{
    use generic-switch
    host_name {{ d.name }}
    address {{ d.primary_ip.address.ip }}
    }
    {% endif %}{% endfor %}
    How can I create *.csv with the same template?

  2. For example I have an export template for "content type: device":
    device name,address,S/N
    {% for d in queryset %}
    {{ d.name }},{{ d.primary_ip4.address }},{{ d.serial }}
    {% endfor %}
    How can I add to this template information from other database tables like "dcim_site" table? For example "dcim_site.name" or "dcim_site.physical_address"?

Thanks.

Originally created by @Sarkaniok on GitHub (Feb 22, 2017). 1) This example below creates only *.txt file : {% for d in queryset %}{% if d.status and d.primary_ip %}define host{ use generic-switch host_name {{ d.name }} address {{ d.primary_ip.address.ip }} } {% endif %}{% endfor %} How can I create *.csv with the same template? 2) For example I have an export template for "content type: device": device name,address,S/N {% for d in queryset %} {{ d.name }},{{ d.primary_ip4.address }},{{ d.serial }} {% endfor %} How can I add to this template information from other database tables like "dcim_site" table? For example "dcim_site.name" or "dcim_site.physical_address"? Thanks.
adam closed this issue 2025-12-29 16:25:06 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 24, 2017):

Please post on the mailing list if you'd like help writing export templates.

@jeremystretch commented on GitHub (Feb 24, 2017): Please post on the [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss) if you'd like help writing export templates.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#722