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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user