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
3a1c40f8
Commit
3a1c40f8
authored
Dec 10, 2013
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refine model manager behavior so as not to use the behavior in incorrect cases. Closes #1205
parent
785a42cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
+7
-1
rest_framework/serializers.py
+7
-1
No files found.
rest_framework/serializers.py
View file @
3a1c40f8
...
@@ -412,7 +412,13 @@ class BaseSerializer(WritableField):
...
@@ -412,7 +412,13 @@ class BaseSerializer(WritableField):
# Set the serializer object if it exists
# Set the serializer object if it exists
obj
=
get_component
(
self
.
parent
.
object
,
self
.
source
or
field_name
)
if
self
.
parent
.
object
else
None
obj
=
get_component
(
self
.
parent
.
object
,
self
.
source
or
field_name
)
if
self
.
parent
.
object
else
None
obj
=
obj
.
all
()
if
is_simple_callable
(
getattr
(
obj
,
'all'
,
None
))
else
obj
# If we have a model manager or similar object then we need
# to iterate through each instance.
if
(
self
.
many
and
not
hasattr
(
obj
,
'__iter__'
)
and
is_simple_callable
(
getattr
(
obj
,
'all'
,
None
))):
obj
=
obj
.
all
()
if
self
.
source
==
'*'
:
if
self
.
source
==
'*'
:
if
value
:
if
value
:
...
...
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