wip installation model
This commit is contained in:
@@ -5,7 +5,7 @@ from netbox.api.serializers import PrimaryModelSerializer, OrganizationalModelSe
|
||||
# NestedRecordSerializer,
|
||||
# NestedNameServerSerializer,
|
||||
# )
|
||||
from netbox_slm.models import SoftwareProduct
|
||||
from netbox_slm.models import SoftwareProduct, SoftwareProductVersion
|
||||
|
||||
|
||||
class SoftwareProductSerializer(PrimaryModelSerializer):
|
||||
@@ -22,3 +22,19 @@ class SoftwareProductSerializer(PrimaryModelSerializer):
|
||||
|
||||
def get_display(self, obj):
|
||||
return obj.name
|
||||
|
||||
|
||||
class SoftwareProductVersionSerializer(PrimaryModelSerializer):
|
||||
display = serializers.SerializerMethodField()
|
||||
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',
|
||||
]
|
||||
|
||||
def get_display(self, obj):
|
||||
return obj.name
|
||||
|
||||
Reference in New Issue
Block a user