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
Copy file name to clipboardExpand all lines: docs/api-guide/serializers.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -799,6 +799,8 @@ To support multiple updates you'll need to do so explicitly. When writing your m
799
799
800
800
You will need to add an explicit `id` field to the instance serializer. The default implicitly-generated `id` field is marked as `read_only`. This causes it to be removed on updates. Once you declare it explicitly, it will be available in the list serializer's `update` method.
801
801
802
+
During validation, `ListSerializer` matches each input item to an existing instance using `pk` by default. To use another identifier, such as `id` or `uuid`, set `lookup_field` on the child serializer's `Meta` class.
803
+
802
804
Here's an example of how you might choose to implement multiple updates:
803
805
804
806
class BookListSerializer(serializers.ListSerializer):
@@ -831,6 +833,7 @@ Here's an example of how you might choose to implement multiple updates:
0 commit comments