mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Wrote API endpoints, tests for ExportTemplates
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
from rest_framework import serializers
|
||||
|
||||
from dcim.api.serializers import NestedSiteSerializer
|
||||
from extras.models import ACTION_CHOICES, Graph, GRAPH_TYPE_CHOICES, TopologyMap, UserAction
|
||||
from extras.models import ACTION_CHOICES, Graph, GRAPH_TYPE_CHOICES, ExportTemplate, TopologyMap, UserAction
|
||||
from users.api.serializers import NestedUserSerializer
|
||||
from utilities.api import ChoiceFieldSerializer
|
||||
|
||||
@ -41,6 +41,17 @@ class RenderedGraphSerializer(serializers.ModelSerializer):
|
||||
return obj.embed_link(self.context['graphed_object'])
|
||||
|
||||
|
||||
#
|
||||
# Export templates
|
||||
#
|
||||
|
||||
class ExportTemplateSerializer(serializers.ModelSerializer):
|
||||
|
||||
class Meta:
|
||||
model = ExportTemplate
|
||||
fields = ['id', 'content_type', 'name', 'description', 'template_code', 'mime_type', 'file_extension']
|
||||
|
||||
|
||||
#
|
||||
# Topology maps
|
||||
#
|
||||
|
Reference in New Issue
Block a user