mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-05 01:16:27 +00:00
serializers pour dnames
This commit is contained in:
parent
05045fc9a1
commit
1a8cb88515
3 changed files with 14 additions and 0 deletions
|
@ -190,6 +190,13 @@ class MxSerializer(NamespacedHMSerializer):
|
||||||
fields = ('zone', 'priority', 'name', 'api_url')
|
fields = ('zone', 'priority', 'name', 'api_url')
|
||||||
|
|
||||||
|
|
||||||
|
class DNameSerializer(NamespacedHMSerializer):
|
||||||
|
"""Serialize `machines.models.DName` objects.
|
||||||
|
"""
|
||||||
|
class Meta:
|
||||||
|
model = machines.DName
|
||||||
|
fields = ('zone', 'alias', 'api_url')
|
||||||
|
|
||||||
class NsSerializer(NamespacedHMSerializer):
|
class NsSerializer(NamespacedHMSerializer):
|
||||||
"""Serialize `machines.models.Ns` objects.
|
"""Serialize `machines.models.Ns` objects.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -51,6 +51,7 @@ router.register_viewset(r'machines/extension', views.ExtensionViewSet)
|
||||||
router.register_viewset(r'machines/mx', views.MxViewSet)
|
router.register_viewset(r'machines/mx', views.MxViewSet)
|
||||||
router.register_viewset(r'machines/ns', views.NsViewSet)
|
router.register_viewset(r'machines/ns', views.NsViewSet)
|
||||||
router.register_viewset(r'machines/txt', views.TxtViewSet)
|
router.register_viewset(r'machines/txt', views.TxtViewSet)
|
||||||
|
router.register_viewset(r'machines/dname', views.DNameViewSet)
|
||||||
router.register_viewset(r'machines/srv', views.SrvViewSet)
|
router.register_viewset(r'machines/srv', views.SrvViewSet)
|
||||||
router.register_viewset(r'machines/interface', views.InterfaceViewSet)
|
router.register_viewset(r'machines/interface', views.InterfaceViewSet)
|
||||||
router.register_viewset(r'machines/ipv6list', views.Ipv6ListViewSet)
|
router.register_viewset(r'machines/ipv6list', views.Ipv6ListViewSet)
|
||||||
|
|
|
@ -162,6 +162,12 @@ class TxtViewSet(viewsets.ReadOnlyModelViewSet):
|
||||||
queryset = machines.Txt.objects.all()
|
queryset = machines.Txt.objects.all()
|
||||||
serializer_class = serializers.TxtSerializer
|
serializer_class = serializers.TxtSerializer
|
||||||
|
|
||||||
|
class DNameViewSet(viewsets.ReadOnlyModelViewSet):
|
||||||
|
"""Exposes list and details of `machines.models.DName` objects.
|
||||||
|
"""
|
||||||
|
queryset = machines.DName.objects.all()
|
||||||
|
serializer_class = serializers.DNameSerializer
|
||||||
|
|
||||||
|
|
||||||
class SrvViewSet(viewsets.ReadOnlyModelViewSet):
|
class SrvViewSet(viewsets.ReadOnlyModelViewSet):
|
||||||
"""Exposes list and details of `machines.models.Srv` objects.
|
"""Exposes list and details of `machines.models.Srv` objects.
|
||||||
|
|
Loading…
Reference in a new issue