mirror of
https://github.com/HackSoftware/Django-Styleguide.git
synced 2025-02-07 07:00:50 +03:00
Fixed List & Detail API serializer signatures
This commit is contained in:
parent
e63afc33f2
commit
efa24c19db
|
@ -335,9 +335,9 @@ class CourseListApi(SomeAuthenticationMixin, APIView):
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
courses = get_courses()
|
courses = get_courses()
|
||||||
|
|
||||||
data = self.OutputSerializer(courses, many=True)
|
serializer = self.OutputSerializer(courses, many=True)
|
||||||
|
|
||||||
return Response(data)
|
return Response(serializer.data)
|
||||||
```
|
```
|
||||||
|
|
||||||
### An example detail API
|
### An example detail API
|
||||||
|
@ -352,9 +352,9 @@ class CourseDetailApi(SomeAuthenticationMixin, APIView):
|
||||||
def get(self, request, course_id):
|
def get(self, request, course_id):
|
||||||
course = get_course(id=course_id)
|
course = get_course(id=course_id)
|
||||||
|
|
||||||
data = self.OutputSerializer(course)
|
serializer = self.OutputSerializer(course)
|
||||||
|
|
||||||
return Response(data)
|
return Response(serializer.data)
|
||||||
```
|
```
|
||||||
|
|
||||||
### An example create API
|
### An example create API
|
||||||
|
|
Loading…
Reference in New Issue
Block a user