You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why do you want to have the relationship in the base? I've simply omitted them from there, as inherit Base to the Create models, which are the POST data that the frontend uses to create objects. Then Read models have such definitions for the relationships that we wanna expose in the API.
I'm using the base model to represent a subset of data useful for certain operations that don't require connection to a database or the entire model to be present.
Yep, you shouldn't do that. If a descendant of the base class is completely overriding the field, then it should probably not be there. In this particular case, it should certainly not be there on the base class.
You would have one field for the table model and another field for the class that inherits from base that needs the relationship.
If you want to avoid duplicating the field with relationships you would need a base for everything, and another "sub-base" only for data models (not tables) that includes the relationship.
First Check
Commit to Help
Example Code
Description
The above code gives the following error:
Because I'm overriding tracks to be a column in my actual database class, this should not error.
Operating System
Linux
Operating System Details
No response
SQLModel Version
0.08
Python Version
3.9.13
Additional Context
Looks to have been caused by #18
The text was updated successfully, but these errors were encountered: