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.
This commit is contained in:
David Davis 2021-01-13 14:37:35 -05:00
parent 19655edbf7
commit 59d9e87de6
No known key found for this signature in database
GPG Key ID: 9D573EFEEDFDC486

View File

@ -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)