aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/serializers.py
diff options
context:
space:
mode:
authorTom Christie2014-11-18 14:49:00 +0000
committerTom Christie2014-11-18 14:49:00 +0000
commit5e74f02d61e05d38bf4e22c6227144def2a96128 (patch)
treeff688e136f6a686162f0d4875fe51373bae1b771 /rest_framework/serializers.py
parent0f508c58211051c873aae5a2d1c65a0c595e732a (diff)
downloaddjango-rest-framework-5e74f02d61e05d38bf4e22c6227144def2a96128.tar.bz2
Note removal of 'save_object' and fail loudly if it exists
Diffstat (limited to 'rest_framework/serializers.py')
-rw-r--r--rest_framework/serializers.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py
index e7e93f38..84282cdb 100644
--- a/rest_framework/serializers.py
+++ b/rest_framework/serializers.py
@@ -108,6 +108,13 @@ class BaseSerializer(Field):
raise NotImplementedError('`create()` must be implemented.')
def save(self, **kwargs):
+ assert not hasattr(self, 'save_object'), (
+ 'Serializer `%s.%s` has old-style version 2 `.save_object()` '
+ 'that is no longer compatible with REST framework 3. '
+ 'Use the new-style `.create()` and `.update()` methods instead.' %
+ (self.__class__.__module__, self.__class__.__name__)
+ )
+
validated_data = dict(
list(self.validated_data.items()) +
list(kwargs.items())