mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-15 08:12:18 -06:00
* 10500 add ModularComponentModel * 10500 add ModularComponentModel * 10500 add to forms * 10500 add to serializer, tables * 10500 template * 10500 add docs * 10500 check recursion * 10500 fix graphql * 10500 fix conflicting migration from merge * 10500 token resolution * 10500 don't return reverse * 10500 don't return reverse / optimize * Add ModuleTypeModuleBaysView * Fix replication of module bays on new modules * Clean up tables & templates * Adjust uniqueness constraints * Correct URL * Clean up docs * Fix up serializers * 10500 add filterset tests * 10500 add nested validation to Module * Misc cleanup * 10500 ModuleBay recursion Test * 10500 ModuleBay recursion Test * 10500 ModuleBay recursion Test * 10500 ModuleBay recursion Test * Enable MPTT for module bays * Fix tests * Fix validation of module token in component names * Misc cleanup * Merge migrations * Fix table ordering --------- Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
@@ -297,6 +297,13 @@ class FrontPortSerializer(NetBoxModelSerializer, CabledObjectSerializer):
|
||||
|
||||
class ModuleBaySerializer(NetBoxModelSerializer):
|
||||
device = DeviceSerializer(nested=True)
|
||||
module = ModuleSerializer(
|
||||
nested=True,
|
||||
fields=('id', 'url', 'display', 'module_bay'),
|
||||
required=False,
|
||||
allow_null=True,
|
||||
default=None
|
||||
)
|
||||
installed_module = ModuleSerializer(
|
||||
nested=True,
|
||||
fields=('id', 'url', 'display', 'serial', 'description'),
|
||||
@@ -307,7 +314,7 @@ class ModuleBaySerializer(NetBoxModelSerializer):
|
||||
class Meta:
|
||||
model = ModuleBay
|
||||
fields = [
|
||||
'id', 'url', 'display_url', 'display', 'device', 'name', 'installed_module', 'label', 'position',
|
||||
'id', 'url', 'display_url', 'display', 'device', 'module', 'name', 'installed_module', 'label', 'position',
|
||||
'description', 'tags', 'custom_fields', 'created', 'last_updated',
|
||||
]
|
||||
brief_fields = ('id', 'url', 'display', 'installed_module', 'name', 'description')
|
||||
|
||||
@@ -253,13 +253,22 @@ class FrontPortTemplateSerializer(ValidatedModelSerializer):
|
||||
|
||||
class ModuleBayTemplateSerializer(ValidatedModelSerializer):
|
||||
device_type = DeviceTypeSerializer(
|
||||
nested=True
|
||||
nested=True,
|
||||
required=False,
|
||||
allow_null=True,
|
||||
default=None
|
||||
)
|
||||
module_type = ModuleTypeSerializer(
|
||||
nested=True,
|
||||
required=False,
|
||||
allow_null=True,
|
||||
default=None
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = ModuleBayTemplate
|
||||
fields = [
|
||||
'id', 'url', 'display', 'device_type', 'name', 'label', 'position', 'description',
|
||||
'id', 'url', 'display', 'device_type', 'module_type', 'name', 'label', 'position', 'description',
|
||||
'created', 'last_updated',
|
||||
]
|
||||
brief_fields = ('id', 'url', 'display', 'name', 'description')
|
||||
|
||||
Reference in New Issue
Block a user