1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #5608: Add REST API endpoint for custom links

This commit is contained in:
Jeremy Stretch
2021-03-08 20:57:44 -05:00
parent 14bc3a3cf8
commit 38ded66c4e
13 changed files with 218 additions and 20 deletions

View File

@ -12,7 +12,7 @@ from rq import Worker
from extras import filters
from extras.choices import JobResultStatusChoices
from extras.models import (
ConfigContext, ExportTemplate, ImageAttachment, ObjectChange, JobResult, Tag, TaggedItem,
ConfigContext, CustomLink, ExportTemplate, ImageAttachment, ObjectChange, JobResult, Tag, TaggedItem,
)
from extras.models import CustomField
from extras.reports import get_report, get_reports, run_report
@ -84,6 +84,17 @@ class CustomFieldModelViewSet(ModelViewSet):
return context
#
# Custom links
#
class CustomLinkViewSet(ModelViewSet):
metadata_class = ContentTypeMetadata
queryset = CustomLink.objects.all()
serializer_class = serializers.CustomLinkSerializer
filterset_class = filters.CustomLinkFilterSet
#
# Export templates
#