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

Create export-rearports-for-adding-details.txt #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gdprdatasubect
Copy link

@gdprdatasubect gdprdatasubect commented Mar 27, 2023

Why? We use Label and description of rear ports to mark in where which room a port ends. After adding the information it can be reimported again thanks to the recently added edit functionality.

Example:
id,name,description,label
1337,1,Wallmounted,R4711
1338,2,In Ceiling ,Floor 0815

Why? We use Label and description of rear ports to mark in where which room a port ends.
After adding the information it can be reimported again thanks to the recently added edit functionality.


Example:
id,name,description,label
1337,1,Wallmounted,R4711
1338,1,In Ceiling ,Floor 0815
@kkthxbye-code
Copy link
Contributor

I get what this is trying to accomplish, but I wonder if its too simple of an export template to warrent inclusion in the repo. Anyone with an opinion here?

@candlerb
Copy link
Contributor

Seems very simple. You could do it without an export templating just by selecting the columns of interest, except that the column headings will be wrong.

If you want a more sophisticated example, you could use something like this for cables:

side_a_device,side_a_type,side_a_name,side_b_device,side_b_type,side_b_name,type,status,label,color,length,length_unit
{%- for c in queryset %}
{%- if c.a_terminations and c.b_terminations %}
{%- set act = c.a_terminations[0].cable_terminations.content_type %}
{%- set bct = c.b_terminations[0].cable_terminations.content_type %}
{%- if act.app_label != 'circuits' and bct.app_label != 'circuits' %}
{{ c.a_terminations[0].device.name }},{{ act.app_label }}.{{ act.model }},{{ c.a_terminations[0].name }},{{ c.b_terminations[0].device.name }},{{ bct.app_label }}.{{ bct.model }},{{ c.b_terminations[0].name }},{{ c.type }},{{ c.status }},"{{ c.label }}",{{c.color}},{{ c.length|default("", True) }},{{ c.length_unit }}
{%- endif %}
{%- endif %}
{%- endfor %}

(although since AFAIK it's not possible to use CSV to import multi-termination cables, this only works if there are single terminations at each end)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants