Search Options

Results per page
Sort
Preferred Languages
Advance

Results 171 - 180 of 855 for asyncpg (0.12 sec)

  1. docs/em/docs/advanced/dataclasses.md

        ๐Ÿ”„, ๐Ÿ‘† ๐Ÿ’ช ๐ŸŒ€ `dataclasses` โฎ๏ธ ๐Ÿฉ ๐Ÿ†Ž โœ.
    
    8๏ธโƒฃ. ๐Ÿ‘€ ๐Ÿ‘ˆ ๐Ÿ‘‰ *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข* โš™๏ธ ๐Ÿฅ” `def` โ†ฉ๏ธ `async def`.
    
        ๐Ÿ•ง, FastAPI ๐Ÿ‘† ๐Ÿ’ช ๐ŸŒ€ `def` & `async def` ๐Ÿ’ช.
    
        ๐Ÿšฅ ๐Ÿ‘† ๐Ÿ’ช โ†—๏ธ ๐Ÿ”ƒ ๐Ÿ•โ” โš™๏ธ โ”, โœ… ๐Ÿ‘… ๐Ÿ“„ _"๐Ÿƒ โ“" _ ๐Ÿฉบ ๐Ÿ”ƒ <a href="https://fastapi.tiangolo.com/async/#in-a-hurry" target="_blank" class="internal-link">`async` &amp; `await`</a>.
    
    9๏ธโƒฃ. ๐Ÿ‘‰ *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข* ๐Ÿšซ ๐Ÿ›ฌ ๐ŸŽป (๐Ÿ‘ โšซ๏ธ ๐Ÿ’ช), โœ‹๏ธ ๐Ÿ“‡ ๐Ÿ“– โฎ๏ธ ๐Ÿ”— ๐Ÿ’ฝ.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  2. docs_src/response_model/tutorial001_01_py39.py

        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: list[str] = []
    
    
    @app.post("/items/")
    async def create_item(item: Item) -> Item:
        return item
    
    
    @app.get("/items/")
    async def read_items() -> list[Item]:
        return [
            Item(name="Portal Gun", price=42.0),
            Item(name="Plumbus", price=32.0),
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Jan 07 13:45:48 UTC 2023
    - 507 bytes
    - Viewed (0)
  3. docs_src/handling_errors/tutorial005.py

    @app.exception_handler(RequestValidationError)
    async def validation_exception_handler(request: Request, exc: RequestValidationError):
        return JSONResponse(
            status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
            content=jsonable_encoder({"detail": exc.errors(), "body": exc.body}),
        )
    
    
    class Item(BaseModel):
        title: str
        size: int
    
    
    @app.post("/items/")
    async def create_item(item: Item):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 667 bytes
    - Viewed (0)
  4. docs_src/handling_errors/tutorial003.py

    
    app = FastAPI()
    
    
    @app.exception_handler(UnicornException)
    async def unicorn_exception_handler(request: Request, exc: UnicornException):
        return JSONResponse(
            status_code=418,
            content={"message": f"Oops! {exc.name} did something. There goes a rainbow..."},
        )
    
    
    @app.get("/unicorns/{name}")
    async def read_unicorn(name: str):
        if name == "yolo":
            raise UnicornException(name=name)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 626 bytes
    - Viewed (0)
  5. tests/test_route_scope.py

    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.get("/users/{user_id}")
    async def get_user(user_id: str, request: Request):
        route: APIRoute = request.scope["route"]
        return {"user_id": user_id, "path": route.path}
    
    
    @app.websocket("/items/{item_id}")
    async def websocket_item(item_id: str, websocket: WebSocket):
        route: APIWebSocketRoute = websocket.scope["route"]
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Feb 08 10:23:07 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  6. fastapi/security/api_key.py

        ```python
        from fastapi import Depends, FastAPI
        from fastapi.security import APIKeyQuery
    
        app = FastAPI()
    
        query_scheme = APIKeyQuery(name="api_key")
    
    
        @app.get("/items/")
        async def read_items(api_key: str = Depends(query_scheme)):
            return {"api_key": api_key}
        ```
        """
    
        def __init__(
            self,
            *,
            name: Annotated[
                str,
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Apr 23 22:29:18 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  7. tests/test_response_class_no_mediatype.py

    
    @app.get(
        "/a",
        response_class=Response,
        responses={500: {"description": "Error", "model": JsonApiError}},
    )
    async def a():
        pass  # pragma: no cover
    
    
    @app.get("/b", responses={500: {"description": "Error", "model": Error}})
    async def b():
        pass  # pragma: no cover
    
    
    client = TestClient(app)
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  8. docs/de/docs/tutorial/dependencies/index.md

    ## `async` oder nicht `async`
    
    Da Abhรคngigkeiten auch von **FastAPI** aufgerufen werden (so wie Ihre *Pfadoperation-Funktionen*), gelten beim Definieren Ihrer Funktionen die gleichen Regeln.
    
    Sie kรถnnen `async def` oder einfach `def` verwenden.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 13K bytes
    - Viewed (0)
  9. docs/ja/docs/tutorial/dependencies/index.md

    ///
    
    ## `async`ใซใ™ใ‚‹ใ‹ใฉใ†ใ‹
    
    ไพๅญ˜้–ขไฟ‚ใฏ **FastAPI**๏ผˆ*path operation้–ขๆ•ฐ*ใจๅŒใ˜๏ผ‰ใ‹ใ‚‰ใ‚‚ๅ‘ผใณๅ‡บใ•ใ‚Œใ‚‹ใŸใ‚ใ€้–ขๆ•ฐใ‚’ๅฎš็พฉใ™ใ‚‹้š›ใซใ‚‚ๅŒใ˜ใƒซใƒผใƒซใŒ้ฉ็”จใ•ใ‚Œใพใ™ใ€‚
    
    `async def`ใ‚„้€šๅธธใฎ`def`ใ‚’ไฝฟ็”จใ™ใ‚‹ใ“ใจใŒใงใใพใ™ใ€‚
    
    ใพใŸใ€้€šๅธธใฎ`def`*path operation้–ขๆ•ฐ*ใฎไธญใซ`async def`ใ‚’ๅ…ฅใ‚Œใฆไพๅญ˜้–ขไฟ‚ใ‚’ๅฎฃ่จ€ใ—ใŸใ‚Šใ€`async def`*path operation้–ขๆ•ฐ*ใฎไธญใซ`def`ใ‚’ๅ…ฅใ‚Œใฆไพๅญ˜้–ขไฟ‚ใ‚’ๅฎฃ่จ€ใ—ใŸใ‚Šใ™ใ‚‹ใ“ใจใชใฉใŒใงใใพใ™ใ€‚
    
    ใใ‚Œใฏ้‡่ฆใงใฏใ‚ใ‚Šใพใ›ใ‚“ใ€‚**FastAPI** ใฏไฝ•ใ‚’ใ™ในใใ‹ใ‚’็Ÿฅใฃใฆใ„ใพใ™ใ€‚
    
    /// note | "ๅ‚™่€ƒ"
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 9.7K bytes
    - Viewed (0)
  10. tests/test_dependency_duplicates.py

    ):
        return [item, sub_item]
    
    
    @app.post("/with-duplicates")
    async def with_duplicates(item: Item, item2: Item = Depends(duplicate_dependency)):
        return [item, item2]
    
    
    @app.post("/no-duplicates")
    async def no_duplicates(item: Item, item2: Item = Depends(dependency)):
        return [item, item2]
    
    
    @app.post("/with-duplicates-sub")
    async def no_duplicates_sub(
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 8.4K bytes
    - Viewed (0)
Back to top