From 59d9e87de679b2393f37fce4572d7308e2681811 Mon Sep 17 00:00:00 2001 From: David Davis Date: Wed, 13 Jan 2021 14:37:35 -0500 Subject: [PATCH] Properly escape code block in docstring Fix a problem where the code block in the ModelSerializer create() docstring was improperly escaped which causes sphinx to raise a warning about the un-terminated strong text. --- rest_framework/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index 49eec8259..e187605da 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -905,13 +905,13 @@ class ModelSerializer(Serializer): """ We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is - essentially just: + essentially just:: return ExampleModel.objects.create(**validated_data) If there are many to many fields present on the instance then they cannot be set until the model is instantiated, in which case the - implementation is like so: + implementation is like so:: example_relationship = validated_data.pop('example_relationship') instance = ExampleModel.objects.create(**validated_data)