Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 199 for Heroes (0.17 sec)

  1. tests/test_tutorial/test_sql_databases/test_tutorial002.py

            hero_id = response.json()["id"]
            response = client.get(f"/heroes/{hero_id}")
            assert response.status_code == 200, response.text
            assert response.json() == snapshot(
                {"name": "Dead Pond", "age": 30, "id": IsInt()}
            )
    
            # Read all heroes
            # Create more heroes first
            response = client.post(
                "/heroes/",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 09 19:44:42 UTC 2024
    - 19.9K bytes
    - Viewed (0)
  2. docs_src/sql_databases/tutorial002.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)
  3. docs_src/sql_databases/tutorial002_an_py310.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)
  4. docs_src/sql_databases/tutorial001_an_py39.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)
  5. scripts/playwright/sql_databases/image01.py

        # Update the viewport manually
        context = browser.new_context(viewport={"width": 960, "height": 1080})
        page = context.new_page()
        page.goto("http://localhost:8000/docs")
        page.get_by_label("post /heroes/").click()
        # Manually add the screenshot
        page.screenshot(path="docs/en/docs/img/tutorial/sql-databases/image01.png")
    
        # ---------------------
        context.close()
        browser.close()
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 09 19:44:42 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  6. scripts/playwright/sql_databases/image02.py

        # Update the viewport manually
        context = browser.new_context(viewport={"width": 960, "height": 1080})
        page = context.new_page()
        page.goto("http://localhost:8000/docs")
        page.get_by_label("post /heroes/").click()
        # Manually add the screenshot
        page.screenshot(path="docs/en/docs/img/tutorial/sql-databases/image02.png")
    
        # ---------------------
        context.close()
        browser.close()
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 09 19:44:42 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  7. docs/pt/docs/tutorial/sql-databases.md

    </details>
    
    Aqui, usamos a dependência `SessionDep` (uma `Session`) para adicionar o novo `Hero` à instância `Session`, fazer commit das alterações no banco de dados, atualizar os dados no `hero` e então retorná-lo.
    
    ### Ler Heroes
    
    Podemos **ler** `Hero`s do banco de dados usando um `select()`. Podemos incluir um `limit` e `offset` para paginar os resultados.
    
    {* ../../docs_src/sql_databases/tutorial001_an_py310.py ln[48:55] hl[51:52,54] *}
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 15:25:29 UTC 2024
    - 15.8K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/sql-databases.md

    </details>
    
    Here we use the `SessionDep` dependency (a `Session`) to add the new `Hero` to the `Session` instance, commit the changes to the database, refresh the data in the `hero`, and then return it.
    
    ### Read Heroes
    
    We can **read** `Hero`s from the database using a `select()`. We can include a `limit` and `offset` to paginate the results.
    
    {* ../../docs_src/sql_databases/tutorial001_an_py310.py ln[48:55] hl[51:52,54] *}
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 09 19:44:42 UTC 2024
    - 14.7K bytes
    - Viewed (0)
  9. docs/fr/docs/features.md

    * Validation pour des types plus exotiques, tel que:
        * URL.
        * Email.
        * UUID.
        * ...et autres.
    
    Toutes les validations sont gérées par le bien établi et robuste **Pydantic**.
    
    ### Sécurité et authentification
    
    La sécurité et l'authentification sont intégrées. Sans aucun compromis avec les bases de données ou les modèles de données.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Aug 06 04:48:30 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  10. guava/src/com/google/common/base/CharMatcher.java

                + "\u1c40\u1c50\ua620\ua8d0\ua900\ua9d0\ua9f0\uaa50\uabf0\uff10";
    
        private static char[] zeroes() {
          return ZEROES.toCharArray();
        }
    
        private static char[] nines() {
          char[] nines = new char[ZEROES.length()];
          for (int i = 0; i < ZEROES.length(); i++) {
            nines[i] = (char) (ZEROES.charAt(i) + 9);
          }
          return nines;
        }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 13:00:28 UTC 2024
    - 53.9K bytes
    - Viewed (0)
Back to top