Skip to content

import nested json data #1507

@matthewhegarty

Description

@matthewhegarty

Discussed in https://github.com/django-import-export/django-import-export/discussions/1506

Originally posted by biscotty666 October 24, 2022
Hi,
I need to import some data from json. The data contains nested objects and I’m unclear how to reference through to that data when writing the resource. I only see documentation about how to access fields at the “root” level of the data structure, not the nested levels. There is a bunch of info on exporting nested structures to json but I haven’t found anything on importing.

[{
    "somekeys": somevalues,
    "roster": [
      {
        "id": "P2021130273",
        "name": "Benja",
        "level": 85,
      },
      { more records },
    ]
}]

My goal is to map to the ids in the “roster” list. Where could I look for this information?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions