Skip to content

All ORMs/backends should allow partial updates #168

@ulasozguler

Description

@ulasozguler

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.

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