Search Options

Results per page
Sort
Preferred Languages
Advance

Results 881 - 890 of 1,127 for def2 (0.06 sec)

  1. docs_src/body_nested_models/tutorial007_py310.py

        images: list[Image] | None = None
    
    
    class Offer(BaseModel):
        name: str
        description: str | None = None
        price: float
        items: list[Item]
    
    
    @app.post("/offers/")
    async def create_offer(offer: Offer):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 520 bytes
    - Viewed (0)
  2. docs_src/query_params_str_validations/tutorial010.py

    from typing import Union
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Union[str, None] = Query(
            default=None,
            alias="item-query",
            title="Query string",
            description="Query string for the items to search in the database that have a good match",
            min_length=3,
            max_length=50,
            pattern="^fixedquery$",
            deprecated=True,
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Oct 24 20:26:06 UTC 2023
    - 574 bytes
    - Viewed (0)
  3. docs_src/path_operation_configuration/tutorial003.py

    
    @app.post(
        "/items/",
        response_model=Item,
        summary="Create an item",
        description="Create an item with all the information, name, description, price, tax and a set of unique tags",
    )
    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
    - 517 bytes
    - Viewed (0)
  4. docs_src/body_nested_models/tutorial006.py

        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: Set[str] = set()
        images: Union[List[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: Sat May 14 11:59:59 UTC 2022
    - 530 bytes
    - Viewed (0)
  5. docs_src/python_types/tutorial008b_py310.py

    def process_item(item: int | str):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 51 bytes
    - Viewed (0)
  6. docs_src/python_types/tutorial009c_py310.py

    def say_hi(name: str | None):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 56 bytes
    - Viewed (0)
  7. .gitignore

    /default.etcd
    
    # Also ignore protoc installed by hack/install-protoc.sh
    /third_party/protoc*
    
    # User cluster configs
    .kubeconfig
    
    .tags*
    
    # Version file for dockerized build
    .dockerized-kube-version-defs
    
    # Web UI
    /www/master/node_modules/
    /www/master/npm-debug.log
    /www/master/shared/config/development.json
    
    # Karma output
    /www/test_out
    
    Registered: Fri Nov 01 09:05:11 UTC 2024
    - Last Modified: Thu Feb 29 08:22:06 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  8. docs_src/schema_extra_example/tutorial004.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: Item = Body(
            examples=[
                {
                    "name": "Foo",
                    "description": "A very nice Item",
                    "price": 35.4,
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Jul 01 16:43:29 UTC 2023
    - 824 bytes
    - Viewed (0)
  9. tests/test_tutorial/test_background_tasks/test_tutorial001.py

    import os
    from pathlib import Path
    
    from fastapi.testclient import TestClient
    
    from docs_src.background_tasks.tutorial001 import app
    
    client = TestClient(app)
    
    
    def test():
        log = Path("log.txt")
        if log.is_file():
            os.remove(log)  # pragma: no cover
        response = client.post("/send-notification/******@****.***")
        assert response.status_code == 200, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Jul 09 18:06:12 UTC 2020
    - 578 bytes
    - Viewed (0)
  10. docs_src/body_multiple_params/tutorial001_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: Annotated[int, Path(title="The ID of the item to get", ge=0, le=1000)],
        q: Union[str, None] = None,
        item: Union[Item, None] = None,
    ):
        results = {"item_id": item_id}
        if q:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 639 bytes
    - Viewed (0)
Back to top