mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-23 12:08:43 -06:00
15156 Add display_url to REST API (#16412)
* 15156 add display_url to REST API * 15156 fix view name * 15156 fix typo * 15156 fix tests * 15156 add url display_url to base class * 15156 add url display_url to base class * 15156 add url display_url to base class * 15156 review changes * 15156 review changes * 15156 review changes * 15156 review changes * 15156 remove bogus code * 15156 remove bogus code * 15156 review changes * 15156 review changes * 15156 review changes --------- Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
@@ -14,7 +14,6 @@ __all__ = (
|
||||
|
||||
|
||||
class ImageAttachmentSerializer(ValidatedModelSerializer):
|
||||
url = serializers.HyperlinkedIdentityField(view_name='extras-api:imageattachment-detail')
|
||||
object_type = ContentTypeField(
|
||||
queryset=ObjectType.objects.all()
|
||||
)
|
||||
@@ -23,8 +22,8 @@ class ImageAttachmentSerializer(ValidatedModelSerializer):
|
||||
class Meta:
|
||||
model = ImageAttachment
|
||||
fields = [
|
||||
'id', 'url', 'display', 'object_type', 'object_id', 'parent', 'name', 'image', 'image_height',
|
||||
'image_width', 'created', 'last_updated',
|
||||
'id', 'url', 'display', 'object_type', 'object_id', 'parent', 'name', 'image',
|
||||
'image_height', 'image_width', 'created', 'last_updated',
|
||||
]
|
||||
brief_fields = ('id', 'url', 'display', 'name', 'image')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user