Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Jinja2 support for export templates #3052

Closed
jeremystretch opened this issue Apr 8, 2019 · 1 comment
Closed

Add Jinja2 support for export templates #3052

jeremystretch opened this issue Apr 8, 2019 · 1 comment
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@jeremystretch
Copy link
Member

Environment

  • Python version: 3.5.6
  • NetBox version: 2.5.9

Proposed Functionality

NetBox allows users to create arbitrary export templates for objects. Currently, these templates must be written in Django's native templating language. This request seeks to add Jinja2 as an alternate template language. While Jinja2 and Django's templating languae are very similar, Jinja2 has the advantages of being more flexible and more commonly understood.

Use Case

Jinja2 allows for more complex language within templates, whereas Django's template language is intentionally limited (with the design goal of pushing logic into the view component of Django's MVT framework).

Database Changes

Add a "template language" field to the ExportTemplate model. This will be set to Django for all existing templates but will default to Jinja2 for all new templates.

External Dependencies

Jinja2 is currently pulled in as a dependency by drf-yasg. It will be listed in requirements.txt as a top-level dependency but should not have any noticeable effect on existing installations.

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application labels Apr 8, 2019
@Grokzen
Copy link
Contributor

Grokzen commented Apr 9, 2019

@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

2 participants