diff --git a/openwisp_network_topology/api/views.py b/openwisp_network_topology/api/views.py index 535b3b9b..4a685164 100644 --- a/openwisp_network_topology/api/views.py +++ b/openwisp_network_topology/api/views.py @@ -4,9 +4,14 @@ BaseNetworkGraphView, BaseReceiveTopologyView, ) +from django_netjsongraph.api.serializers import NetworkGraphSerializer from ..models import Snapshot, Topology +# TODO: use swappable model loading to define this at serializer level +NetworkGraphSerializer.Meta.model = Topology +NetworkGraphSerializer.Meta.fields = '__all__' + class NetworkCollectionView(BaseNetworkCollectionView): queryset = Topology.objects.filter(published=True)