jonra1993 / fastapi-alembic-sqlmodel-async

This is a project template which uses FastAPI, Pydantic 2.0, Alembic and async SQLModel as ORM. It shows a complete async CRUD using authentication and role base access control.
MIT License
964 stars 150 forks source link

Update partial.py #48

Closed jymchng closed 1 year ago

jymchng commented 1 year ago

add the following 2 lines:

if _cls.__fields__[field].default:
        _cls.__fields__[field].default = None

the optional decorator is meant for IUpdateSchemaType and an 'UpdateSchema' should have all its fields' default set to None.

jonra1993 commented 1 year ago

Thanks @jymchng for this PR