Open w1tht0uchp4d opened 3 weeks ago
Both ConfigTemplate and ExportTemplate inherits from ExportTemplatesMixin
In ConfigTemplate there are params/methods like: environment_params def render() def _get_environment()
Idk if it's too much for export templates but would it be great to move such params/functions to ExportTemplatesMixin ? Or modify utilities.jinja2.py ? At least, use the same enviroment creation for both cases.
NetBox version
3.7.5
Feature type
Change to existing functionality
Proposed functionality
The goal is to achieve feature parity between the [Provisioning --> Config Templates edit] and [Customization --> Export Templates dialog]. In config templates it is possible to use jinja environment parameters, in export templates it is not. It's also the same behavior in Netbox v4.1.2 (checked via demo application).
Use case
I'm currently implementing a custom export template, which exports prefixes, their assigned VLANs and some custom fields. I'm aware that part of this, is also achievable via the csv export function, but I want to add some semantic sugar via the power of Jinja, like adding first host address, last host address, ... The messy white space handling with jinja, unfortunately destroys the formatting of the csv.
Database changes
None required?
External dependencies
None?