-
-
Notifications
You must be signed in to change notification settings - Fork 4
Usermodel relationships #1
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
Usermodel relationships #1
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 74 79 +5
=========================================
+ Hits 74 79 +5
Continue to review full report at Codecov.
|
|
Hi @LonelyVikingMichael and thank you for tackling this! I see that you added a I was thinking about this: we could add an optional Then, we could do |
|
Oh, you are absolutely right. I like your proposed solution, that should work. I will do a quick test to see what we can pass to |
|
Hi @frankie567
For a moment I thought: simply not adding the relationship fields to the Pydantic models ( I am just unsure about one thing, should the |
|
I guess it would be better if we let the responsibility of saving related objects to the end user. If they really need to save it all at once, they could easily overload the method. |
|
Hey Frankie Is anything else required to get this approved? |
|
Hmm, no, it sounds good! Sorry, it was out of my mind! |
Reference issue:
fastapi-users/fastapi-users#751
This PR aims to allow relationships to be both stored and read on the
Usermodel, so that relationships may be retrieved on e.g.GET /meThis is achieved by minor tweaks on the
create()and_get_db_user()methods respectively, using only code fromormaritself.One test has been added, all tests are passing.
Thank you for your work, I really enjoy using FastAPI-Users!