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
I'm grabbing some records off a remote MariaDB database with FastAPI and SQLModel and displying them in a Jinja2 template. I'm getting my four expected keys and values (customerNumber, customerName, city, country), but I'm also getting an unexpected key:value pair (_sa_instance_state)
How do I avoid generating or including this data?
note: When I use the following FastAPI everything returns as expected (and in proper order):
@router.get("/customers/", response_model=list[Customers])
async def read_customers(*, session: Session = Depends(get_session)):
result = session.query(Customers).all()
return result
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
I'm grabbing some records off a remote MariaDB database with FastAPI and SQLModel and displying them in a Jinja2 template. I'm getting my four expected keys and values (customerNumber, customerName, city, country), but I'm also getting an unexpected key:value pair (_sa_instance_state)
How do I avoid generating or including this data?
note: When I use the following FastAPI everything returns as expected (and in proper order):
@router.get("/customers/", response_model=list[Customers])
async def read_customers(*, session: Session = Depends(get_session)):
result = session.query(Customers).all()
return result
Operating System
Windows
Operating System Details
No response
SQLModel Version
0.0.8
Python Version
3.10.2
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions