PowerFeedSerializer should subclass ConnectedEndpointSerializer

This commit is contained in:
Jeremy Stretch 2020-10-05 11:39:17 -04:00
parent b846f631a4
commit 32aa2daea6
2 changed files with 4 additions and 2 deletions

View File

@ -68,6 +68,7 @@ All end-to-end cable paths are now cached using the new CablePath model. This al
* dcim.FrontPort: Removed the `trace` endpoint
* dcim.Interface: Replaced `connection_status` with `connected_endpoint_reachable` (boolean)
* dcim.InventoryItem: The `_depth` field has been added to reflect MPTT positioning
* dcim.PowerFeed: Add fields `connected_endpoint`, `connected_endpoint_type`, and `connected_endpoint_reachable`
* dcim.PowerOutlet: Replaced `connection_status` with `connected_endpoint_reachable` (boolean)
* dcim.PowerPanel: Added `custom_fields`
* dcim.PowerPort: Replaced `connection_status` with `connected_endpoint_reachable` (boolean)

View File

@ -760,7 +760,7 @@ class PowerPanelSerializer(TaggedObjectSerializer, CustomFieldModelSerializer):
fields = ['id', 'url', 'site', 'rack_group', 'name', 'tags', 'custom_fields', 'powerfeed_count']
class PowerFeedSerializer(TaggedObjectSerializer, CustomFieldModelSerializer):
class PowerFeedSerializer(TaggedObjectSerializer, ConnectedEndpointSerializer, CustomFieldModelSerializer):
url = serializers.HyperlinkedIdentityField(view_name='dcim-api:powerfeed-detail')
power_panel = NestedPowerPanelSerializer()
rack = NestedRackSerializer(
@ -790,5 +790,6 @@ class PowerFeedSerializer(TaggedObjectSerializer, CustomFieldModelSerializer):
model = PowerFeed
fields = [
'id', 'url', 'power_panel', 'rack', 'name', 'status', 'type', 'supply', 'phase', 'voltage', 'amperage',
'max_utilization', 'comments', 'tags', 'custom_fields', 'created', 'last_updated', 'cable',
'max_utilization', 'comments', 'tags', 'custom_fields', 'created', 'last_updated',
'connected_endpoint_type', 'connected_endpoint', 'connected_endpoint_reachable', 'cable',
]