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
Your question is not precise at all, I strongly suggest using precise words and proper code formatting when creating issues on GitHub ;) At least I can guess.
Standard way is to use SQLAlchemy (1.4 style) query:
@router.get("/", response_model=List[schemas.Cat])asyncdefread_cats(
offset: int=0,
limit: int=100,
current_user: models.User=Depends(deps.get_current_user),
session: AsyncSession=Depends(deps.get_session),
):
""" Get all cats """cats_result=awaitsession.execute(select(models.Cat).offset(offset).limit(limit))
returncats_result.scalars().all()
With this as an example, how would you return a list of items?
`@router.get("/", response_model=List[schemas.Cat])
async def read_cat(
cat: schemas.Cat,
session: AsyncSession = Depends(deps.get_session),
current_user: models.User = Depends(deps.get_current_user),
) -> List:
"""
Get cats.
"""
The text was updated successfully, but these errors were encountered: