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
9dbaac31
Commit
9dbaac31
authored
May 22, 2012
by
Tom Christie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #210 from max-arnold/serialize-raw-queryset
Small patch to allow RawQuerySet serialization
parents
0c82e4b5
b689db17
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
djangorestframework/serializer.py
+2
-2
No files found.
djangorestframework/serializer.py
View file @
9dbaac31
...
...
@@ -2,7 +2,7 @@
Customizable serialization.
"""
from
django.db
import
models
from
django.db.models.query
import
QuerySet
from
django.db.models.query
import
QuerySet
,
RawQuerySet
from
django.utils.encoding
import
smart_unicode
,
is_protected_type
,
smart_str
import
inspect
...
...
@@ -261,7 +261,7 @@ class Serializer(object):
if
isinstance
(
obj
,
(
dict
,
models
.
Model
)):
# Model instances & dictionaries
return
self
.
serialize_model
(
obj
)
elif
isinstance
(
obj
,
(
tuple
,
list
,
set
,
QuerySet
,
types
.
GeneratorType
)):
elif
isinstance
(
obj
,
(
tuple
,
list
,
set
,
QuerySet
,
RawQuerySet
,
types
.
GeneratorType
)):
# basic iterables
return
self
.
serialize_iter
(
obj
)
elif
isinstance
(
obj
,
models
.
Manager
):
...
...
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