export template formating with jinja #15105
Replies: 1 comment 3 replies
-
Probably your timeout from gunicorn or apache/nginx is too short, and these can be increased. If you want to reduce the number of devices in your export, there are many approaches, including:
Alternatively, you could change from using export templates or reports to scripts. Scripts work in the background, and the browser polls every few seconds until they are completed. I think I saw that merging Reports and Scripts is being considered for a future version.
A device doesn't have an attribute The best way to test these attributes interactively is in nbshell
However in this case there's a better approach: filter the list of devices top be exported.
Again, see the template designer documentation linked above, especially the section on whitespace control. You probably want:
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I am trying to create export template for our EOL devices list but netbox always give proxy error because of long list which cannot be handle by netbox so , is it possible to limit the ouput with number of lines in the csv file with jinja2 template?
**{% for device in queryset %}
{% if device.sites == "eu" %}
{% endif %}
{% endfor %}**
and finally when I download csv it give the output with one line spacing instead so is there any way to remove the blank line in CSV (null line while)
![image](https://private-user-images.githubusercontent.com/55275995/303759241-5c089d40-ab45-46bb-a139-e082f5ecef3b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEwNDY4ODEsIm5iZiI6MTcyMTA0NjU4MSwicGF0aCI6Ii81NTI3NTk5NS8zMDM3NTkyNDEtNWMwODlkNDAtYWI0NS00NmJiLWExMzktZTA4MmY1ZWNlZjNiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE1VDEyMjk0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg1ZGEwMDViYjQzYWMxZTdkZGY0MWI3NjQzZmFjOThiOTEwMWU5ZWJjNThjNzBmM2YzNjlkZjE1NDYxODU0ZDAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.7ipRPM4-zRvvETz1ECcFhuxRR4iCcwLioeYf0urt8qw)
Sorry I have asked multiple queries in one quiestion...
Beta Was this translation helpful? Give feedback.
All reactions