Skip to content

Need help with Custom Script and Interface Template Filtering #19186

Closed Answered by chris240189
heidl89 asked this question in Q&A
Discussion options

You must be logged in to vote

why don't you use
device.device_type.interfacetemplates.all() to get all the interfacetemplates that device_type has directly?

anyway, your filtering should work just fine. I just did some tests on my netbox and it works like it should in nb-shell:
`>>> device = Device.objects.get(name='')

intf_templates = InterfaceTemplate.objects.all()
len(intf_templates)
1278
intf_templates = InterfaceTemplate.objects.filter(device_type = device.device_type)
len(intf_templates)
57`

what version of netbox are you using?

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by heidl89
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants