Skip to content

Add function to trim whitespaces in export templates via jinja environment settings #17653

Closed
@w1tht0uchp4d

Description

@w1tht0uchp4d

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?

Metadata

Metadata

Labels

complexity: lowRequires minimal effort to implementnetboxstatus: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions