Skip to content

Commit

Permalink
Merge pull request #100 from DanSheps/develop
Browse files Browse the repository at this point in the history
Remove nested serializers
  • Loading branch information
DanSheps authored Sep 5, 2024
2 parents 28dad67 + dfe9e77 commit 89e8027
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
3 changes: 1 addition & 2 deletions netbox_config_backup/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from .serializers import *
from .nested_serializers import *
from .serializers import *
19 changes: 0 additions & 19 deletions netbox_config_backup/api/nested_serializers.py

This file was deleted.

8 changes: 4 additions & 4 deletions netbox_config_backup/api/serializers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from rest_framework import serializers

from dcim.api.nested_serializers import NestedDeviceSerializer
from ipam.api.nested_serializers import NestedIPAddressSerializer
from dcim.api.serializers import DeviceSerializer
from ipam.api.serializers import IPAddressSerializer
from netbox.api.serializers import NetBoxModelSerializer

from netbox_config_backup.models import Backup
Expand All @@ -14,8 +14,8 @@

class BackupSerializer(NetBoxModelSerializer):
url = serializers.HyperlinkedIdentityField(view_name='plugins-api:netbox_config_backup-api:backup-detail')
device = NestedDeviceSerializer()
ip = NestedIPAddressSerializer()
device = DeviceSerializer(nested=True)
ip = IPAddressSerializer(nested=True)

class Meta:
model = Backup
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='netbox_config_backup',
version='2.1.0-beta1',
version='2.1.0',
description='NetBox Configuration Backup',
long_description='Plugin to backup device configuration',
url='https://github.com/dansheps/netbox-config-backup/',
Expand Down

0 comments on commit 89e8027

Please sign in to comment.