This commit is contained in:
Waylon Walker 2023-06-11 14:10:20 -05:00
parent f6a3e69536
commit 7cce3940fc
3 changed files with 45 additions and 9 deletions

View file

@ -13,6 +13,7 @@ from learn_sql_model.models.hero import (
HeroDelete,
HeroRead,
HeroUpdate,
Heros,
)
hero_app = typer.Typer()
@ -44,8 +45,18 @@ def list(
limit: Optional[int] = None,
) -> Union[Hero, List[Hero]]:
"list many heros"
hero = HeroRead.list(where=where, offset=offset, limit=limit)
Console().print(hero)
heros = Heros.list(where=where, offset=offset, limit=limit)
Console().print(heros)
return hero
@hero_app.command()
def clear() -> Union[Hero, List[Hero]]:
"list many heros"
heros = Heros.list()
for hero in heros.heros:
HeroDelete(id=hero.id).delete()
return hero