- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 201 for Heroes (0.04 sec)
-
docs_src/sql_databases/tutorial002_py310.py
offset: int = 0, limit: int = Query(default=100, le=100), ): heroes = session.exec(select(Hero).offset(offset).limit(limit)).all() return heroes @app.get("/heroes/{hero_id}", response_model=HeroPublic) def read_hero(hero_id: int, session: Session = Depends(get_session)): hero = session.get(Hero, hero_id) if not hero: raise HTTPException(status_code=404, detail="Hero not found") return hero
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 09 19:44:42 UTC 2024 - 2.5K bytes - Viewed (0) -
docs_src/sql_databases/tutorial001_an_py310.py
create_db_and_tables() @app.post("/heroes/") def create_hero(hero: Hero, session: SessionDep) -> Hero: session.add(hero) session.commit() session.refresh(hero) return hero @app.get("/heroes/") def read_heroes( session: SessionDep, offset: int = 0, limit: Annotated[int, Query(le=100)] = 100, ) -> list[Hero]: heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 09 19:44:42 UTC 2024 - 1.7K bytes - Viewed (0) -
docs_src/sql_databases/tutorial002_an.py
): heroes = session.exec(select(Hero).offset(offset).limit(limit)).all() return heroes @app.get("/heroes/{hero_id}", response_model=HeroPublic) def read_hero(hero_id: int, session: SessionDep): hero = session.get(Hero, hero_id) if not hero: raise HTTPException(status_code=404, detail="Hero not found") return hero @app.patch("/heroes/{hero_id}", response_model=HeroPublic)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 09 19:44:42 UTC 2024 - 2.6K bytes - Viewed (0) -
docs_src/sql_databases/tutorial002_py39.py
offset: int = 0, limit: int = Query(default=100, le=100), ): heroes = session.exec(select(Hero).offset(offset).limit(limit)).all() return heroes @app.get("/heroes/{hero_id}", response_model=HeroPublic) def read_hero(hero_id: int, session: Session = Depends(get_session)): hero = session.get(Hero, hero_id) if not hero: raise HTTPException(status_code=404, detail="Hero not found") return hero
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 09 19:44:42 UTC 2024 - 2.6K bytes - Viewed (0) -
docs_src/sql_databases/tutorial001_py39.py
) -> list[Hero]: heroes = session.exec(select(Hero).offset(offset).limit(limit)).all() return heroes @app.get("/heroes/{hero_id}") def read_hero(hero_id: int, session: Session = Depends(get_session)) -> Hero: hero = session.get(Hero, hero_id) if not hero: raise HTTPException(status_code=404, detail="Hero not found") return hero @app.delete("/heroes/{hero_id}")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 09 19:44:42 UTC 2024 - 1.8K bytes - Viewed (0) -
docs_src/sql_databases/tutorial002_an_py39.py
): heroes = session.exec(select(Hero).offset(offset).limit(limit)).all() return heroes @app.get("/heroes/{hero_id}", response_model=HeroPublic) def read_hero(hero_id: int, session: SessionDep): hero = session.get(Hero, hero_id) if not hero: raise HTTPException(status_code=404, detail="Hero not found") return hero @app.patch("/heroes/{hero_id}", response_model=HeroPublic)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 09 19:44:42 UTC 2024 - 2.5K bytes - Viewed (0) -
docs_src/sql_databases/tutorial001_an.py
create_db_and_tables() @app.post("/heroes/") def create_hero(hero: Hero, session: SessionDep) -> Hero: session.add(hero) session.commit() session.refresh(hero) return hero @app.get("/heroes/") def read_heroes( session: SessionDep, offset: int = 0, limit: Annotated[int, Query(le=100)] = 100, ) -> List[Hero]: heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 09 19:44:42 UTC 2024 - 1.8K bytes - Viewed (0) -
tests/test_tutorial/test_sql_databases/test_tutorial001.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 09 19:44:42 UTC 2024 - 14.8K bytes - Viewed (0) -
docs_src/sql_databases/tutorial001.py
) -> List[Hero]: heroes = session.exec(select(Hero).offset(offset).limit(limit)).all() return heroes @app.get("/heroes/{hero_id}") def read_hero(hero_id: int, session: Session = Depends(get_session)) -> Hero: hero = session.get(Hero, hero_id) if not hero: raise HTTPException(status_code=404, detail="Hero not found") return hero @app.delete("/heroes/{hero_id}")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 09 19:44:42 UTC 2024 - 1.8K bytes - Viewed (0) -
docs_src/sql_databases/tutorial001_py310.py
) -> list[Hero]: heroes = session.exec(select(Hero).offset(offset).limit(limit)).all() return heroes @app.get("/heroes/{hero_id}") def read_hero(hero_id: int, session: Session = Depends(get_session)) -> Hero: hero = session.get(Hero, hero_id) if not hero: raise HTTPException(status_code=404, detail="Hero not found") return hero @app.delete("/heroes/{hero_id}")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 09 19:44:42 UTC 2024 - 1.7K bytes - Viewed (0)