Skip to content

Is there a way to mix single object and list ? #48

@keomabrun

Description

@keomabrun

Example:

{
    "Play" : {"genre": "Comedy", "title": "A Midsummer Night"s Dream", "pages": 350},
    "Poem" : [
        {"title": "Shall I compare thee to a summer"s day", "stanzas": 1},
        {"title": "As a decrepit father takes delight", "stanzas": 1},
        ....
    ],
}

So far I've managed to achieve it by adding a many=[True|False] argument, and modifying the serializer call, but I wonder if there is another (already existing) way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions