Replies: 1 comment
-
It would be wrong to say that those are equal, by default, as If you want, you can however define the equality check how you want, by overriding It might be confusing to make non-equal objects equal, though, so perhaps for your purpose you want some new method, like |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
In our project, we read data from files or APIs and use it to create objects. Then, we check whether we already have that data in our database by comparing some key data points. If we find a match, we want to check if the new object is equal to the one in the database.
Currently, we use a SQLAlchemy class and a Pydantic model that have similar fields for this task. However, we recently discovered SQLModel and hoped to simplify the process by using it for both the data and database models, with inheritance.
However, when we tried this approach, we noticed that the objects are never considered equal. We're not sure if we made a mistake or if there's something we need to change to achieve the desired behavior.
Operating System
Linux, macOS
Operating System Details
No response
SQLModel Version
0.0.6
Python Version
3.9
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions