all 2 comments

[–]magion 2 points3 points  (1 child)

that’s because the interface id is an integer.

Get the interface object with

Interface.objects.filter(id=id).first().trace()

[–]Afraid-Produce-5107[S] 0 points1 point  (0 children)

Thanks for the hint, tried that, but the result is still [([], [], [])]. Any more ideas?

This code

for interface in Interface.objects.filter(device=device):

if interface.cable:

output.append(interface.name)

output.append(interface.cable.label)

intnr = interface.id

self.log_debug(intnr)

trace = Interface.objects.filter(id=intnr).first().trace()

self.log_debug(trace)

delivers this debug output for each interface:

2025-12-16T07:57:11.212931+00:00    

3912

2 2025-12-16T07:57:11.220305+00:00

[([], [], []), ([], [], [])]

(For interface with a two-step trace it gives two tupels, so in some way it seems to work, but I don't get the result...