You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an internal request to include the list of prefixes linked to a VLAN in the API. I have already written a small plugin to enhance the API with this and other features. But I thought that might be useful for others as well to avoid multiple calls to the API.
Actually the change would be very simple to just add those two lines to the serializer for the VLAN:
Only drawback from this simple solution is that the prefixes inside the VLAN object would have a reference to the VLAN itself.
But that could be avoided by adding a extra serializer for the prefixes that does not have the VLAN reference.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have an internal request to include the list of prefixes linked to a VLAN in the API. I have already written a small plugin to enhance the API with this and other features. But I thought that might be useful for others as well to avoid multiple calls to the API.
Actually the change would be very simple to just add those two lines to the serializer for the VLAN:
prefixes = serializers.PrefixSerializer(read_only=True, many=True)
Only drawback from this simple solution is that the prefixes inside the VLAN object would have a reference to the VLAN itself.
But that could be avoided by adding a extra serializer for the prefixes that does not have the VLAN reference.
Beta Was this translation helpful? Give feedback.
All reactions