79663080

Date: 2025-06-12 07:26:00
Score: 0.5
Natty:
Report link

If you want to send ids in the request and expect dictionary of items in the response, then this approach might be useful.

tag = TagSerializer(many=True, read_only=True)
tag_ids = serializers.PrimaryKeyRelatedField(
    queryset=Tag.objects.all(),
    many=True,
    write_only=True,
    source="tag",
)
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: George Nigoghossian