This commit is contained in:
Waylon Walker 2023-06-09 16:36:23 -05:00
parent 864321a45b
commit 53d878c75a
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4
4 changed files with 64 additions and 5 deletions

View file

@ -5,7 +5,7 @@ import httpx
from pydantic import BaseModel
from sqlmodel import Field, Relationship, SQLModel, Session, select
from learn_sql_model.config import config, get_session
from learn_sql_model.config import config, get_config
from learn_sql_model.models.pet import Pet
@ -55,10 +55,12 @@ class HeroRead(HeroBase):
where=None,
offset=0,
limit=None,
session: Session = get_session,
session: Session = None,
) -> Hero:
# with config.database.session as session:
if session is None:
session = get_config().database.session
statement = select(Hero)
if where != "None" and where is not None:
from sqlmodel import text