Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All ORMs/backends should allow partial updates #168

Open
ulasozguler opened this issue Aug 31, 2022 · 0 comments
Open

All ORMs/backends should allow partial updates #168

ulasozguler opened this issue Aug 31, 2022 · 0 comments

Comments

@ulasozguler
Copy link

ulasozguler commented Aug 31, 2022

Currently, only tortoise and ormar backends are allowing partial updates. See relevant line for tortoise below.

**model.dict(exclude_unset=True)

Behaviour should be consistent across all backends when possible.

Requirement of fields should be determined by pydantic model as its primary function is validation.
Currently, marking a field of pydantic model as Optional or setting a default value doesn't allow skipping that field when sending a request (for backends other than tortoise and ormar).

Making this change would allow to both keeping the current behaviour and enabling partial updates depending on your pydantic model.

I can create a pull request for this if it gets approved. I have already tested it in my local environment and doesn't seem to break anything else.

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

No branches or pull requests

1 participant