Skip to content

Commit 74e4a30

Browse files
committed
fix #139
1 parent a7422e0 commit 74e4a30

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

netbox_bgp/api/serializers.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,15 @@ class BGPSessionSerializer(NetBoxModelSerializer):
103103

104104
class Meta:
105105
model = BGPSession
106-
fields = '__all__'
106+
#fields = '__all__'
107+
fields = [
108+
'id', 'tags', 'custom_fields',
109+
'display', 'status', 'site', 'tenant',
110+
'device', 'local_address', 'remote_address',
111+
'local_as', 'remote_as', 'peer_group', 'import_policies',
112+
'export_policies', 'created', 'last_updated',
113+
'name', 'description'
114+
]
107115
validators = []
108116

109117
def validate(self, attrs):
@@ -152,7 +160,13 @@ class CommunitySerializer(NetBoxModelSerializer):
152160
class Meta:
153161
model = Community
154162
# fields = ['id', 'value', 'status', 'description', 'tenant', 'tags']
155-
fields = '__all__'
163+
fields = [
164+
'id', 'tags', 'custom_fields', 'display',
165+
'status', 'tenant', 'created', 'last_updated',
166+
'description',
167+
'value', 'site', 'role'
168+
]
169+
# fields = '__all__'
156170

157171

158172
class RoutingPolicyRuleSerializer(NetBoxModelSerializer):
@@ -172,7 +186,7 @@ class NestedPrefixListSerializer(WritableNestedSerializer):
172186

173187
class Meta:
174188
model = PrefixList
175-
fields = ("id", "url", "display", "name")
189+
fields = ['id', 'url', 'display', 'name']
176190

177191

178192
class PrefixListRuleSerializer(NetBoxModelSerializer):
@@ -181,3 +195,9 @@ class PrefixListRuleSerializer(NetBoxModelSerializer):
181195
class Meta:
182196
model = PrefixListRule
183197
fields = '__all__'
198+
fields = [
199+
'id', 'tags', 'custom_fields', 'display',
200+
'prefix_list', 'created', 'last_updated',
201+
'index', 'action',
202+
'prefix_custom', 'ge', 'le', 'prefix'
203+
]

0 commit comments

Comments
 (0)