I have a Django 1.9 project and a REST view which receives from client-side a list objects, so the code looks like this:
Client-side object:
[
{
"field_a": "...",
"field_b": "..."
},
{
"field_a": "...",
"field_b": "..."
}
]
The view:
@api_view(['POST'])
def send_sim_info(request):
serializer = MySerializer(data=request.data, many=True)
So the serializer is of type ListSerializer
QUESTION:
How do I add fields to request.data in this case? In one object case, I would just write request.data['addition_field'] = my_value. What is the cleanest way to do a similar trick for the case of array?