You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -65,7 +65,7 @@ For example, the following serializer.
65
65
model = Album
66
66
fields = ['album_name', 'artist', 'tracks']
67
67
68
-
Would serialize to the following representation.
68
+
Would serialize to the following representation:
69
69
70
70
{
71
71
'album_name': 'Things We Lost In The Fire',
@@ -291,7 +291,7 @@ Would serialize to a nested representation like this:
291
291
292
292
## Writable nested serializers
293
293
294
-
By default nested serializers are read-only. If you want to support write-operations to a nested serializer field you'll need to create `create()` and/or `update()` methods in order to explicitly specify how the child relationships should be saved.
294
+
By default nested serializers are read-only. If you want to support write-operations to a nested serializer field you'll need to create `create()` and/or `update()` methods in order to explicitly specify how the child relationships should be saved:
295
295
296
296
class TrackSerializer(serializers.ModelSerializer):
297
297
class Meta:
@@ -343,7 +343,7 @@ To provide a dynamic queryset based on the `context`, you can also override `.ge
343
343
344
344
## Example
345
345
346
-
For example, we could define a relational field to serialize a track to a custom string representation, using its ordering, title, and duration.
346
+
For example, we could define a relational field to serialize a track to a custom string representation, using its ordering, title, and duration:
347
347
348
348
import time
349
349
@@ -359,7 +359,7 @@ For example, we could define a relational field to serialize a track to a custom
359
359
model = Album
360
360
fields = ['album_name', 'artist', 'tracks']
361
361
362
-
This custom field would then serialize to the following representation.
362
+
This custom field would then serialize to the following representation:
363
363
364
364
{
365
365
'album_name': 'Sometimes I Wish We Were an Eagle',
@@ -535,7 +535,7 @@ And the following two models, which may have associated tags:
535
535
text = models.CharField(max_length=1000)
536
536
tags = GenericRelation(TaggedItem)
537
537
538
-
We could define a custom field that could be used to serialize tagged instances, using the type of each instance to determine how it should be serialized.
538
+
We could define a custom field that could be used to serialize tagged instances, using the type of each instance to determine how it should be serialized:
539
539
540
540
class TaggedObjectRelatedField(serializers.RelatedField):
0 commit comments