Expand Export Template to allow for non-attachment response #4574

Closed
opened 2025-12-29 18:37:50 +01:00 by adam · 4 comments
Owner

Originally created by @rodvand on GitHub (Feb 17, 2021).

Originally assigned to: @rodvand on GitHub.

Environment

  • Python version: 3.6.8
  • NetBox version: 2.10.4

Proposed Functionality

Add an option to the Export Template functionality where it does not download the export template as an attachment, but instead presents it right away.

Use Case

Allow rendered content to be opened straight away. Currently I am generating a link using the Export Template and am required to open the downloaded attachment and click on the link to access the page. Being able to adjust this behaviour would make for a smoother workflow.

Database Changes

Boolean field on the ExportTemplate model for deciding whether to set the Content-Disposition to attachment. Suggests to set this default as True to keep the current workflow as standard.

External Dependencies

None

On my test instance I commented out the line 3d3748d6f5/netbox/extras/models/models.py (L279) and this gave me the behaviour I'm describing.

Originally created by @rodvand on GitHub (Feb 17, 2021). Originally assigned to: @rodvand on GitHub. ### Environment * Python version: 3.6.8 * NetBox version: 2.10.4 ### Proposed Functionality Add an option to the Export Template functionality where it does not download the export template as an attachment, but instead presents it right away. ### Use Case Allow rendered content to be opened straight away. Currently I am generating a link using the Export Template and am required to open the downloaded attachment and click on the link to access the page. Being able to adjust this behaviour would make for a smoother workflow. ### Database Changes Boolean field on the ExportTemplate model for deciding whether to set the Content-Disposition to attachment. Suggests to set this default as True to keep the current workflow as standard. ### External Dependencies None On my test instance I commented out the line https://github.com/netbox-community/netbox/blob/3d3748d6f54cd2bd168554b141b5f3541a0b88ac/netbox/extras/models/models.py#L279 and this gave me the behaviour I'm describing.
adam added the status: acceptedtype: feature labels 2025-12-29 18:37:50 +01:00
adam closed this issue 2025-12-29 18:37:50 +01:00
Author
Owner

@rodvand commented on GitHub (Feb 23, 2021):

I can take a stab at it if you assign it to me.

@rodvand commented on GitHub (Feb 23, 2021): I can take a stab at it if you assign it to me.
Author
Owner

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

I'm assuming this will require the addition of a new boolean field on the ExportTemplate model? In that case, this needs to be wait for a milestone assignment. It's a minor change though, obviously; we can tag it for v2.11.

@jeremystretch commented on GitHub (Feb 24, 2021): I'm assuming this will require the addition of a new boolean field on the ExportTemplate model? In that case, this needs to be wait for a milestone assignment. It's a minor change though, obviously; we can tag it for v2.11.
Author
Owner

@rodvand commented on GitHub (Mar 30, 2021):

Will we manage to get this into 2.11? If needed I can try to work on this.

@rodvand commented on GitHub (Mar 30, 2021): Will we manage to get this into 2.11? If needed I can try to work on this.
Author
Owner

@jeremystretch commented on GitHub (Mar 30, 2021):

@rodvand go for it! I would like to get the v2.11 beta out this week, though, if possible. Let me know if you'd rather me knock it out.

We can either add a boolean field to control the content disposition header, or add it only when a file extension is set.

@jeremystretch commented on GitHub (Mar 30, 2021): @rodvand go for it! I would like to get the v2.11 beta out this week, though, if possible. Let me know if you'd rather me knock it out. We can either add a boolean field to control the content disposition header, or add it only when a file extension is set.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4574