Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
55fd6466
Commit
55fd6466
authored
Feb 06, 2013
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set many explicitly from mixins. Refs #564.
parent
cc2ec2bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
rest_framework/generics.py
+2
-2
rest_framework/mixins.py
+1
-1
No files found.
rest_framework/generics.py
View file @
55fd6466
...
...
@@ -48,7 +48,7 @@ class GenericAPIView(views.APIView):
return
serializer_class
def
get_serializer
(
self
,
instance
=
None
,
data
=
None
,
files
=
None
,
partial
=
False
):
files
=
None
,
partial
=
False
,
many
=
False
):
"""
Return the serializer instance that should be used for validating and
deserializing input, and for serializing output.
...
...
@@ -56,7 +56,7 @@ class GenericAPIView(views.APIView):
serializer_class
=
self
.
get_serializer_class
()
context
=
self
.
get_serializer_context
()
return
serializer_class
(
instance
,
data
=
data
,
files
=
files
,
partial
=
partial
,
context
=
context
)
many
=
many
,
partial
=
partial
,
context
=
context
)
class
MultipleObjectAPIView
(
MultipleObjectMixin
,
GenericAPIView
):
...
...
rest_framework/mixins.py
View file @
55fd6466
...
...
@@ -65,7 +65,7 @@ class ListModelMixin(object):
paginator
,
page
,
queryset
,
is_paginated
=
packed
serializer
=
self
.
get_pagination_serializer
(
page
)
else
:
serializer
=
self
.
get_serializer
(
self
.
object_list
)
serializer
=
self
.
get_serializer
(
self
.
object_list
,
many
=
True
)
return
Response
(
serializer
.
data
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment