aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/serializers.py
diff options
context:
space:
mode:
authorTom Christie2013-01-30 20:38:11 +0000
committerTom Christie2013-01-30 20:38:11 +0000
commitf1e665673feeca945561a7b7cef251c86254eed8 (patch)
tree8722a1b8a6d2f5a6e7d18c45f7a7aad5c5b05913 /rest_framework/serializers.py
parente4ac566625dcb2858ce15148e38595b49eedfa1b (diff)
downloaddjango-rest-framework-f1e665673feeca945561a7b7cef251c86254eed8.tar.bz2
Tidying
Diffstat (limited to 'rest_framework/serializers.py')
-rw-r--r--rest_framework/serializers.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py
index d02e1ada..258f9d62 100644
--- a/rest_framework/serializers.py
+++ b/rest_framework/serializers.py
@@ -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