Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Add bulk operation support #367

Closed
Closed
@zivSher

Description

@zivSher

Hi guys,
I'm trying to post an array of objects. (it's basically a list of dictionaries).
I'm getting
'if data.get('type') != resource_name and request.method in ('PUT', 'POST', 'PATCH'):
AttributeError: 'list' object has no attribute 'get''

from the parsers.py.
Seems like it doesn't know to handle a case where the data is a list.
Is that functionality missing or am I doing something wrong?

I'm using 'many=true' in the serializer.

This is the data I'm sending:
{
"data": [
{
"type": "admin_mappings",
"attributes": {
"oxygen_id": "2222",
"type": "1",
"my_role": "manager"
},
"relationships": {
"container": {
"data": {
"type": "containers",
"id": "5d0554d1-22b3-441c-89f5-d6d5cdd74451"
}
}
}
},
{
"type": "admin_mappings",
"attributes": {
"oxygen_id": "3333",
"type": "1",
"my_role": "manager"
},
"relationships": {
"container": {
"data": {
"type": "containers",
"id": "5d0554d1-22b3-441c-89f5-d6d5cdd74451"
}
}
}
}]
}

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions