I am using Django REST generic views for my API endpoint. One of the field in my serializer has ManyToMany relationship. I want to show that field into my API endpoint, But getting this error
Lists are not currently supported in HTML input.
My view is this:
class AlertCreateView(ListCreateAPIView):
permission_classes = (IsAuthenticated,)
pagination_class = None
serializer_class = AlertSerializer
def get_queryset(self):
queues = Queue.objects.all()
for queue in queues:
queryset = Alert.objects.filter(
queue=queue
)
return queryset
My Serializer is this:
class AlertSerializer(serializers.ModelSerializer):
queue = QueueSerializer(many=True)
class Meta:
model = Alert
fields = (
'id', 'name', 'queue','email', 'expected_qos'
)