get dict as query result instead of model object?
Here is my code:
def get_user(sql: Session, username: str):
"""return user data"""
user = sql.query(Users).filter(Users.Username == username).first()
print(user) # <== <app.models.users_model.Users object at 0x7f0bce46a250>
return user
Yes. You can use the core API
Обсуждают сегодня