Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Saving Reference field along with object in POST request #118

@anujism

Description

@anujism

I would like to save the reference field along with object in post request. Is there any way to do this?

For eg.

class User(db.Document):
    name = db.StringField(required=True, unique=True)

class Post(db.Document):
    # Some fields
    # ...
   author = db.ReferenceField(User)

Now, I want to create author while making a POST request:
/post/ => { "author": { "name": "Test" }, ..other fields }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions