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
f1e66567
Commit
f1e66567
authored
Jan 30, 2013
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tidying
parent
e4ac5666
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
rest_framework/serializers.py
+10
-3
No files found.
rest_framework/serializers.py
View file @
f1e66567
...
...
@@ -95,15 +95,19 @@ class SerializerOptions(object):
class
BaseSerializer
(
Field
):
"""
This is the Serializer implementation.
We need to implement it as `BaseSerializer` due to metaclass magicks.
"""
class
Meta
(
object
):
pass
_options_class
=
SerializerOptions
_dict_class
=
SortedDictWithMetadata
# Set to unsorted dict for backwards compatibility with unsorted implementations.
_dict_class
=
SortedDictWithMetadata
def
__init__
(
self
,
instance
=
None
,
data
=
None
,
files
=
None
,
context
=
None
,
partial
=
False
,
**
kwargs
):
super
(
BaseSerializer
,
self
)
.
__init__
(
**
kwargs
)
context
=
None
,
partial
=
False
,
source
=
None
):
super
(
BaseSerializer
,
self
)
.
__init__
(
source
=
source
)
self
.
opts
=
self
.
_options_class
(
self
.
Meta
)
self
.
parent
=
None
self
.
root
=
None
...
...
@@ -347,6 +351,9 @@ class BaseSerializer(Field):
@property
def
data
(
self
):
"""
Returns the serialized data on the serializer.
"""
if
self
.
_data
is
None
:
self
.
_data
=
self
.
to_native
(
self
.
object
)
return
self
.
_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