-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '55-fix-inventory' into 'development'
fix: inventory upload cant determin object organization Closes #55 See merge request nofusscomputing/projects/django_template!24
- Loading branch information
Showing
10 changed files
with
418 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
from django.urls import reverse | ||
|
||
from itam.models.device import Device | ||
from rest_framework import serializers | ||
|
||
|
||
|
||
|
||
class InventorySerializer(serializers.Serializer): | ||
""" Serializer for Inventory Upload """ | ||
|
||
|
||
class DetailsSerializer(serializers.Serializer): | ||
|
||
name = serializers.CharField( | ||
help_text = 'Host name', | ||
required = True | ||
) | ||
|
||
serial_number = serializers.CharField( | ||
help_text = 'Devices serial number', | ||
required = True | ||
) | ||
|
||
uuid = serializers.CharField( | ||
help_text = 'Device system UUID', | ||
required = True | ||
) | ||
|
||
|
||
class OperatingSystemSerializer(serializers.Serializer): | ||
|
||
name = serializers.CharField( | ||
help_text='Name of the operating system installed on the device', | ||
required = True, | ||
) | ||
|
||
version_major = serializers.IntegerField( | ||
help_text='Major semver version number of the OS version', | ||
required = True, | ||
) | ||
|
||
version = serializers.CharField( | ||
help_text='semver version number of the OS', | ||
required = True | ||
) | ||
|
||
|
||
class SoftwareSerializer(serializers.Serializer): | ||
|
||
name = serializers.CharField( | ||
help_text='Name of the software', | ||
required = True | ||
) | ||
|
||
category = serializers.CharField( | ||
help_text='Category of the software', | ||
default = None, | ||
required = False | ||
) | ||
|
||
version = serializers.CharField( | ||
default = None, | ||
help_text='semver version number of the software', | ||
required = False | ||
) | ||
|
||
|
||
details = DetailsSerializer() | ||
|
||
os = OperatingSystemSerializer() | ||
|
||
software = SoftwareSerializer(many = True) |
Oops, something went wrong.