Last active
November 23, 2020 05:08
-
-
Save Allwin12/dd9e0ae1d0acc790794e312460eeb826 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rest_framework.response import Response | |
from rest_framework.views import APIView | |
from rest_framework_xml.renderers import XMLRenderer | |
from student.models import School | |
from student.serializers import SchoolListSerializer | |
class SchoolView(APIView): | |
renderer_classes = [XMLRenderer, ] | |
def get(self, request): | |
schools = School.objects.all() | |
school_serializer = SchoolListSerializer(schools, many=True) | |
return Response(school_serializer.data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment