Search Options

Results per page
Sort
Preferred Languages
Advance

Results 821 - 830 of 1,127 for def2 (0.03 sec)

  1. docs_src/custom_response/tutorial003.py

    from fastapi import FastAPI
    from fastapi.responses import HTMLResponse
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items():
        html_content = """
        <html>
            <head>
                <title>Some HTML in here</title>
            </head>
            <body>
                <h1>Look ma! HTML!</h1>
            </body>
        </html>
        """
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 394 bytes
    - Viewed (0)
  2. docs_src/dataclasses/tutorial001.py

    
    @dataclass
    class Item:
        name: str
        price: float
        description: Union[str, None] = None
        tax: Union[float, None] = None
    
    
    app = FastAPI()
    
    
    @app.post("/items/")
    async def create_item(item: Item):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 312 bytes
    - Viewed (0)
  3. docs_src/bigger_applications/app_an_py39/main.py

    app.include_router(
        admin.router,
        prefix="/admin",
        tags=["admin"],
        dependencies=[Depends(get_token_header)],
        responses={418: {"description": "I'm a teapot"}},
    )
    
    
    @app.get("/")
    async def root():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 552 bytes
    - Viewed (0)
  4. docs_src/body_nested_models/tutorial005_py310.py

    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
        tags: set[str] = set()
        image: Image | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Item):
        results = {"item_id": item_id, "item": item}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 468 bytes
    - Viewed (0)
  5. docs_src/query_params_str_validations/tutorial008_an_py310.py

    from typing import Annotated
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Annotated[
            str | None,
            Query(
                title="Query string",
                description="Query string for the items to search in the database that have a good match",
                min_length=3,
            ),
        ] = None,
    ):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Oct 24 20:26:06 UTC 2023
    - 498 bytes
    - Viewed (0)
  6. docs_src/schema_extra_example/tutorial003_py310.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        item_id: int,
        item: Item = Body(
            examples=[
                {
                    "name": "Foo",
                    "description": "A very nice Item",
                    "price": 35.4,
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 574 bytes
    - Viewed (0)
  7. docs_src/query_param_models/tutorial001_an.py

        limit: int = Field(100, gt=0, le=100)
        offset: int = Field(0, ge=0)
        order_by: Literal["created_at", "updated_at"] = "created_at"
        tags: List[str] = []
    
    
    @app.get("/items/")
    async def read_items(filter_query: Annotated[FilterParams, Query()]):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 478 bytes
    - Viewed (0)
  8. docs_src/query_param_models/tutorial002_pv1_an_py39.py

        limit: int = Field(100, gt=0, le=100)
        offset: int = Field(0, ge=0)
        order_by: Literal["created_at", "updated_at"] = "created_at"
        tags: list[str] = []
    
    
    @app.get("/items/")
    async def read_items(filter_query: Annotated[FilterParams, Query()]):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 497 bytes
    - Viewed (0)
  9. docs_src/query_param_models/tutorial002_pv1_py39.py

        limit: int = Field(100, gt=0, le=100)
        offset: int = Field(0, ge=0)
        order_by: Literal["created_at", "updated_at"] = "created_at"
        tags: list[str] = []
    
    
    @app.get("/items/")
    async def read_items(filter_query: FilterParams = Query()):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 476 bytes
    - Viewed (0)
  10. scripts/playwright/separate_openapi_schemas/image01.py

    import subprocess
    
    from playwright.sync_api import Playwright, sync_playwright
    
    
    # Run playwright codegen to generate the code below, copy paste the sections in run()
    def run(playwright: Playwright) -> None:
        browser = playwright.chromium.launch(headless=False)
        # Update the viewport manually
        context = browser.new_context(viewport={"width": 960, "height": 1080})
        page = context.new_page()
        page.goto("http://localhost:8000/docs")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Sep 13 09:14:46 UTC 2024
    - 974 bytes
    - Viewed (0)
Back to top