Skip to content

Commit

Permalink
Merge pull request #132 from Chankster/main
Browse files Browse the repository at this point in the history
Added nested PrefixList serializer for PrefixListRules
  • Loading branch information
k01ek authored Mar 14, 2023
2 parents f5d905d + e0c4feb commit a0d925a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions netbox_bgp/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__'

0 comments on commit a0d925a

Please sign in to comment.