mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Closes #4994: Add cable attribute to PowerFeed API serializer
This commit is contained in:
@ -355,4 +355,4 @@ class NestedPowerFeedSerializer(WritableNestedSerializer):
|
||||
|
||||
class Meta:
|
||||
model = models.PowerFeed
|
||||
fields = ['id', 'url', 'name']
|
||||
fields = ['id', 'url', 'name', 'cable']
|
||||
|
@ -782,10 +782,11 @@ class PowerFeedSerializer(TaggedObjectSerializer, CustomFieldModelSerializer):
|
||||
choices=PowerFeedPhaseChoices,
|
||||
default=PowerFeedPhaseChoices.PHASE_SINGLE
|
||||
)
|
||||
cable = NestedCableSerializer(read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = PowerFeed
|
||||
fields = [
|
||||
'id', 'url', 'power_panel', 'rack', 'name', 'status', 'type', 'supply', 'phase', 'voltage', 'amperage',
|
||||
'max_utilization', 'comments', 'tags', 'custom_fields', 'created', 'last_updated',
|
||||
'max_utilization', 'comments', 'tags', 'custom_fields', 'created', 'last_updated', 'cable',
|
||||
]
|
||||
|
@ -1959,7 +1959,7 @@ class PowerPanelTest(APIViewTestCases.APIViewTestCase):
|
||||
|
||||
class PowerFeedTest(APIViewTestCases.APIViewTestCase):
|
||||
model = PowerFeed
|
||||
brief_fields = ['id', 'name', 'url']
|
||||
brief_fields = ['cable', 'id', 'name', 'url']
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
|
Reference in New Issue
Block a user