β¨ Improving compatibility with MappedAsDataclass by adding kw_only=True in models
#1439
jd-solanki
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi ππ»
I really python types and use it everywhere. I also use
MappedAsDataclassto get autosuggestions when I want to create instance of model. However, When we use it along with FastAPIUsers we get known error of ordering. See SA issue: sqlalchemy/sqlalchemy#10105As per the Michael's answer we can add
kw_only=Trueto mixin. If we don't do this if someone like me is usingMappedAsDataclassand want to add more cols to user table will stuck due to this error.Hence, if you allow I'll create a new PR that just adds
kw_only=Trueto base models of FastAPI users.Beta Was this translation helpful? Give feedback.
All reactions