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

Saving Reference field along with object in POST request #118

Open
anujism opened this issue Sep 6, 2018 · 0 comments
Open

Saving Reference field along with object in POST request #118

anujism opened this issue Sep 6, 2018 · 0 comments

Comments

@anujism
Copy link

anujism commented Sep 6, 2018

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 }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant