diff --git a/docs/api-guide/fields.md b/docs/api-guide/fields.md index e964458f9..65c83b78e 100644 --- a/docs/api-guide/fields.md +++ b/docs/api-guide/fields.md @@ -597,8 +597,6 @@ The `.to_representation()` method is called to convert the initial datatype into The `to_internal_value()` method is called to restore a primitive datatype into its internal python representation. This method should raise a `serializers.ValidationError` if the data is invalid. -Note that the `WritableField` class that was present in version 2.x no longer exists. You should subclass `Field` and override `to_internal_value()` if the field supports data input. - ## Examples ### A Basic Custom Field diff --git a/docs/api-guide/generic-views.md b/docs/api-guide/generic-views.md index a2f19ff2e..a256eb2d9 100644 --- a/docs/api-guide/generic-views.md +++ b/docs/api-guide/generic-views.md @@ -175,8 +175,6 @@ You can also use these hooks to provide additional validation, by raising a `Val raise ValidationError('You have already signed up') serializer.save(user=self.request.user) -**Note**: These methods replace the old-style version 2.x `pre_save`, `post_save`, `pre_delete` and `post_delete` methods, which are no longer available. - **Other methods**: You won't typically need to override the following methods, although you might need to call into them if you're writing custom views using `GenericAPIView`. diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index c20b60aad..8c2486bea 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -166,13 +166,6 @@ 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__) - ) - assert hasattr(self, '_errors'), ( 'You must call `.is_valid()` before calling `.save()`.' ) @@ -216,13 +209,6 @@ class BaseSerializer(Field): return self.instance def is_valid(self, raise_exception=False): - assert not hasattr(self, 'restore_object'), ( - 'Serializer `%s.%s` has old-style version 2 `.restore_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__) - ) - assert hasattr(self, 'initial_data'), ( 'Cannot call `.is_valid()` as no `data=` keyword argument was ' 'passed when instantiating the serializer instance.'