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
Here we are adding two aliases to the same Model in sqlmodel and selecting both in the query. The query seems to run properly since the result shows ModelX (the aliased model) in the results. However, result._mapping, which generally returns a dictionary-like mapping from each selectable name to the selected model/field, does not include the aliased models. The example code should hopefully show this clearly, but happy to provide more context if need be.
I can't find anything that would show this is as a sqlalchemy issue since the query is running properly, just ._mapping is not. However, I am using aliased from sqlalchemy.orm
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
First Check
Commit to Help
Example Code
Description
Here we are adding two aliases to the same Model in sqlmodel and selecting both in the query. The query seems to run properly since the
result
shows ModelX (the aliased model) in the results. However,result._mapping
, which generally returns a dictionary-like mapping from each selectable name to the selected model/field, does not include the aliased models. The example code should hopefully show this clearly, but happy to provide more context if need be.I can't find anything that would show this is as a sqlalchemy issue since the query is running properly, just
._mapping
is not. However, I am usingaliased
fromsqlalchemy.orm
Operating System
macOS
Operating System Details
No response
SQLModel Version
0.0.21
Python Version
3.12.2
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions