mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-17 21:18:16 -06:00
adds data to data-file serializer #14908
This commit is contained in:
parent
c8fb948a91
commit
aa28a44956
@ -47,13 +47,19 @@ class DataFileSerializer(NetBoxModelSerializer):
|
||||
source = NestedDataSourceSerializer(
|
||||
read_only=True
|
||||
)
|
||||
data = serializers.SerializerMethodField(
|
||||
read_only=True
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = DataFile
|
||||
fields = [
|
||||
'id', 'url', 'display', 'source', 'path', 'last_updated', 'size', 'hash',
|
||||
'id', 'url', 'display', 'source', 'path', 'last_updated', 'size', 'hash', 'data'
|
||||
]
|
||||
|
||||
def get_data(self, obj):
|
||||
return obj.data_as_string
|
||||
|
||||
|
||||
class JobSerializer(BaseModelSerializer):
|
||||
url = serializers.HyperlinkedIdentityField(view_name='core-api:job-detail')
|
||||
|
Loading…
Reference in New Issue
Block a user