Search Options

Results per page
Sort
Preferred Languages
Advance

Results 301 - 310 of 1,072 for Str (0.06 sec)

  1. docs/em/docs/tutorial/body-nested-models.md

    * πŸ’½ πŸ› οΈ
    * πŸ’½ πŸ”¬
    * 🏧 🧾
    
    ## 🎁 πŸ†Ž & πŸ”¬
    
    ↖️ βšͺ️➑️ 😐 ⭐ πŸ†Ž πŸ’– `str`, `int`, `float`, ♒️. πŸ‘† πŸ’ͺ βš™οΈ πŸŒ… πŸ— ⭐ πŸ†Ž πŸ‘ˆ πŸ˜– βšͺ️➑️ `str`.
    
    πŸ‘€ 🌐 πŸŽ› πŸ‘† βœ”οΈ, πŸ›’ 🩺 <a href="https://docs.pydantic.dev/latest/concepts/types/" class="external-link" target="_blank">Pydantic 😍 πŸ†Ž</a>. πŸ‘† πŸ”œ πŸ‘€ πŸ–Ό ⏭ πŸ“ƒ.
    
    πŸ–Ό, `Image` 🏷 πŸ‘₯ βœ”οΈ `url` πŸ‘, πŸ‘₯ πŸ’ͺ πŸ“£ ⚫️ ↩️ `str`, Pydantic `HttpUrl`:
    
    //// tab | 🐍 3️⃣.6️⃣ &amp; πŸ”›
    
    ```Python hl_lines="4  10"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  2. docs_src/additional_status_codes/tutorial001_an_py39.py

    app = FastAPI()
    
    items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "size": 3}}
    
    
    @app.put("/items/{item_id}")
    async def upsert_item(
        item_id: str,
        name: Annotated[Union[str, None], Body()] = None,
        size: Annotated[Union[int, None], Body()] = None,
    ):
        if item_id in items:
            item = items[item_id]
            item["name"] = name
            item["size"] = size
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 705 bytes
    - Viewed (0)
  3. docs_src/body_fields/tutorial001_an.py

    from typing import Union
    
    from fastapi import Body, FastAPI
    from pydantic import BaseModel, Field
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = Field(
            default=None, title="The description of the item", max_length=300
        )
        price: float = Field(gt=0, description="The price must be greater than zero")
        tax: Union[float, None] = None
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 611 bytes
    - Viewed (0)
  4. docs_src/dependencies/tutorial008c_an_py39.py

    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("Oops, we didn't raise again, Britney 😱")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
            raise InternalError(
                f"The portal gun is too dangerous to be owned by {username}"
            )
        if item_id != "plumbus":
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 700 bytes
    - Viewed (0)
  5. docs/de/docs/tutorial/path-params.md

    ### Erstellen Sie eine `Enum`-Klasse
    
    Importieren Sie `Enum` und erstellen Sie eine Unterklasse, die von `str` und `Enum` erbt.
    
    Indem Sie von `str` erben, weiß die API Dokumentation, dass die Werte des Enums vom Typ `str` sein müssen, und wird in der Lage sein, korrekt zu rendern.
    
    Erstellen Sie dann Klassen-Attribute mit festgelegten Werten, welches die erlaubten Werte sein werden:
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  6. docs_src/settings/app01/config.py

    from pydantic_settings import BaseSettings
    
    
    class Settings(BaseSettings):
        app_name: str = "Awesome API"
        admin_email: str
        items_per_user: int = 50
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 183 bytes
    - Viewed (0)
  7. 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)
  8. docs_src/body/tutorial001_py310.py

    from fastapi import FastAPI
    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/settings/app03/config.py

    from pydantic_settings import BaseSettings
    
    
    class Settings(BaseSettings):
        app_name: str = "Awesome API"
        admin_email: str
        items_per_user: int = 50
    
        class Config:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 204 bytes
    - Viewed (0)
  10. docs_src/additional_status_codes/tutorial001_an.py

    app = FastAPI()
    
    items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "size": 3}}
    
    
    @app.put("/items/{item_id}")
    async def upsert_item(
        item_id: str,
        name: Annotated[Union[str, None], Body()] = None,
        size: Annotated[Union[int, None], Body()] = None,
    ):
        if item_id in items:
            item = items[item_id]
            item["name"] = name
            item["size"] = size
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 734 bytes
    - Viewed (0)
Back to top