Assorted fixes (#25)

* Updated imports for Netbox 3.6.1

Closes #21 and #23

* Changed Fieldtypes of Start and Expiration Date

Closes #22

* Bump to NetBox v3.6.1

* Add pyproject.toml and python workflow

---------

Co-authored-by: Manuel Hartung <manuel.hartung@atos.net>
This commit is contained in:
wkoot
2023-09-15 09:41:36 +02:00
co-authored by Manuel Hartung
parent 6c512e0e9b
commit aa41f8a402
26 changed files with 492 additions and 565 deletions
+47 -18
View File
@@ -6,15 +6,19 @@ from netbox_slm.models import SoftwareProduct, SoftwareProductVersion, SoftwareP
class SoftwareProductSerializer(NetBoxModelSerializer):
display = serializers.SerializerMethodField()
url = serializers.HyperlinkedIdentityField(
view_name="plugins-api:netbox_slm-api:softwareproduct-detail"
)
url = serializers.HyperlinkedIdentityField(view_name="plugins-api:netbox_slm-api:softwareproduct-detail")
class Meta:
model = SoftwareProduct
fields = [
'id', 'display', 'url', 'name',
'tags', 'custom_field_data', 'created', 'last_updated',
"id",
"display",
"url",
"name",
"tags",
"custom_field_data",
"created",
"last_updated",
]
def get_display(self, obj):
@@ -23,15 +27,20 @@ class SoftwareProductSerializer(NetBoxModelSerializer):
class SoftwareProductVersionSerializer(NetBoxModelSerializer):
display = serializers.SerializerMethodField()
url = serializers.HyperlinkedIdentityField(
view_name="plugins-api:netbox_slm-api:softwareproductversion-detail"
)
url = serializers.HyperlinkedIdentityField(view_name="plugins-api:netbox_slm-api:softwareproductversion-detail")
class Meta:
model = SoftwareProductVersion
fields = [
'id', 'display', 'url', 'name', 'software_product',
'tags', 'custom_field_data', 'created', 'last_updated',
"id",
"display",
"url",
"name",
"software_product",
"tags",
"custom_field_data",
"created",
"last_updated",
]
def get_display(self, obj):
@@ -47,8 +56,17 @@ class SoftwareProductInstallationSerializer(NetBoxModelSerializer):
class Meta:
model = SoftwareProductInstallation
fields = [
'id', 'display', 'url', 'device', 'virtualmachine', 'software_product', 'version',
'tags', 'custom_field_data', 'created', 'last_updated',
"id",
"display",
"url",
"device",
"virtualmachine",
"software_product",
"version",
"tags",
"custom_field_data",
"created",
"last_updated",
]
def get_display(self, obj):
@@ -57,16 +75,27 @@ class SoftwareProductInstallationSerializer(NetBoxModelSerializer):
class SoftwareLicenseSerializer(NetBoxModelSerializer):
display = serializers.SerializerMethodField()
url = serializers.HyperlinkedIdentityField(
view_name="plugins-api:netbox_slm-api:softwarelicense-detail"
)
url = serializers.HyperlinkedIdentityField(view_name="plugins-api:netbox_slm-api:softwarelicense-detail")
class Meta:
model = SoftwareLicense
fields = [
'id', 'display', 'url', 'name', 'description', 'type', 'stored_location',
'start_date', 'expiration_date', 'software_product', 'version', 'installation',
'tags', 'custom_field_data', 'created', 'last_updated',
"id",
"display",
"url",
"name",
"description",
"type",
"stored_location",
"start_date",
"expiration_date",
"software_product",
"version",
"installation",
"tags",
"custom_field_data",
"created",
"last_updated",
]
def get_display(self, obj):