diff --git a/netbox_bgp/api/serializers.py b/netbox_bgp/api/serializers.py index 46a01d6..e64e407 100644 --- a/netbox_bgp/api/serializers.py +++ b/netbox_bgp/api/serializers.py @@ -167,7 +167,17 @@ class Meta: fields = '__all__' +class NestedPrefixListSerializer(WritableNestedSerializer): + url = HyperlinkedIdentityField(view_name='plugins:netbox_bgp:prefixlist') + + class Meta: + model = PrefixList + fields = ("id", "url", "display", "name") + + class PrefixListRuleSerializer(NetBoxModelSerializer): + prefix_list = NestedPrefixListSerializer() + class Meta: model = PrefixListRule fields = '__all__'