@@ -135,61 +135,6 @@ def create(self, validated_data):
135135 return instance
136136
137137
138- class SegmentListSerializer (NetBoxModelSerializer ):
139- """Lightweight serializer for list views - excludes heavy geometry fields"""
140-
141- url = serializers .HyperlinkedIdentityField (view_name = "plugins-api:cesnet_service_path_plugin-api:segment-detail" )
142- provider = ProviderSerializer (required = True , nested = True )
143- site_a = SiteSerializer (required = True , nested = True )
144- location_a = LocationSerializer (required = True , nested = True )
145- site_b = SiteSerializer (required = True , nested = True )
146- location_b = LocationSerializer (required = True , nested = True )
147- circuits = CircuitSerializer (required = False , many = True , nested = True )
148-
149- # Only include lightweight path info
150- has_path_data = serializers .SerializerMethodField (read_only = True )
151-
152- class Meta :
153- model = Segment
154- fields = (
155- "id" ,
156- "url" ,
157- "display" ,
158- "name" ,
159- "status" ,
160- "network_label" ,
161- "install_date" ,
162- "termination_date" ,
163- "provider" ,
164- "provider_segment_id" ,
165- "provider_segment_name" ,
166- "provider_segment_contract" ,
167- "site_a" ,
168- "location_a" ,
169- "site_b" ,
170- "location_b" ,
171- "circuits" ,
172- # Only basic path info, no heavy geometry
173- "path_length_km" ,
174- "path_source_format" ,
175- "path_notes" ,
176- "has_path_data" ,
177- "tags" ,
178- )
179- brief_fields = (
180- "id" ,
181- "url" ,
182- "display" ,
183- "name" ,
184- "status" ,
185- "has_path_data" ,
186- "tags" ,
187- )
188-
189- def get_has_path_data (self , obj ):
190- return obj .has_path_data ()
191-
192-
193138class SegmentDetailSerializer (NetBoxModelSerializer ):
194139 """Full serializer with all geometry data for detail views"""
195140
0 commit comments