Skip to content

Add bulk operation support #367

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy