Search Options

Results per page
Sort
Preferred Languages
Advance

Results 711 - 720 of 1,127 for def2 (0.05 sec)

  1. docs_src/python_types/tutorial003.py

    def get_name_with_age(name: str, age: int):
        name_with_age = name + " is this old: " + age
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 119 bytes
    - Viewed (0)
  2. docs_src/async_tests/main.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    async def root():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 08 18:01:18 UTC 2020
    - 112 bytes
    - Viewed (0)
  3. docs_src/body_fields/tutorial001_py310.py

        )
        price: float = Field(gt=0, description="The price must be greater than zero")
        tax: float | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Item = Body(embed=True)):
        results = {"item_id": item_id, "item": item}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 523 bytes
    - Viewed (0)
  4. docs_src/schema_extra_example/tutorial003_an.py

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        item_id: int,
        item: Annotated[
            Item,
            Body(
                examples=[
                    {
                        "name": "Foo",
                        "description": "A very nice Item",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 721 bytes
    - Viewed (0)
  5. docs_src/python_types/tutorial006.py

    from typing import List
    
    
    def process_items(items: List[str]):
        for item in items:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 106 bytes
    - Viewed (0)
  6. docs_src/query_params/tutorial002.py

    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_item(item_id: str, q: Union[str, None] = None):
        if q:
            return {"item_id": item_id, "q": q}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 251 bytes
    - Viewed (0)
  7. docs_src/bigger_applications/app_an_py39/internal/admin.py

    from fastapi import APIRouter
    
    router = APIRouter()
    
    
    @router.post("/")
    async def update_admin():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 147 bytes
    - Viewed (0)
  8. docs_src/body/tutorial001_py310.py

    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: 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: Fri Jan 07 14:11:31 UTC 2022
    - 271 bytes
    - Viewed (0)
  9. docs_src/query_params_str_validations/tutorial014_an_py310.py

    from typing import Annotated
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        hidden_query: Annotated[str | None, Query(include_in_schema=False)] = None,
    ):
        if hidden_query:
            return {"hidden_query": hidden_query}
        else:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 331 bytes
    - Viewed (0)
  10. docs_src/path_params/tutorial001.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_item(item_id):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 138 bytes
    - Viewed (0)
Back to top