fixed netbox.js issue, with display field; fixed api select bootstrap
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from rest_framework import serializers
|
||||
|
||||
from netbox.api.serializers import PrimaryModelSerializer
|
||||
from netbox.api.serializers import PrimaryModelSerializer, OrganizationalModelSerializer
|
||||
# from netbox_slm.api.nested_serializers import (
|
||||
# NestedRecordSerializer,
|
||||
# NestedNameServerSerializer,
|
||||
@@ -9,18 +9,16 @@ from netbox_slm.models import SoftwareProduct
|
||||
|
||||
|
||||
class SoftwareProductSerializer(PrimaryModelSerializer):
|
||||
display = serializers.SerializerMethodField()
|
||||
url = serializers.HyperlinkedIdentityField(
|
||||
view_name="plugins-api:netbox_slm-api:softwareproduct-detail"
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = SoftwareProduct
|
||||
fields = (
|
||||
"id",
|
||||
"url",
|
||||
"name",
|
||||
"tags",
|
||||
"custom_field_data",
|
||||
"created",
|
||||
"last_updated",
|
||||
)
|
||||
fields = [
|
||||
'id', 'display', 'url', 'name', 'tags', 'custom_field_data', 'created', 'last_updated',
|
||||
]
|
||||
|
||||
def get_display(self, obj):
|
||||
return obj.name
|
||||
|
||||
Reference in New Issue
Block a user