Search Options

Results per page
Sort
Preferred Languages
Advance

Results 161 - 170 of 1,072 for Str (0.03 sec)

  1. fastapi/security/open_id_connect_url.py

        dependency.
        """
    
        def __init__(
            self,
            *,
            openIdConnectUrl: Annotated[
                str,
                Doc(
                    """
                The OpenID Connect URL.
                """
                ),
            ],
            scheme_name: Annotated[
                Optional[str],
                Doc(
                    """
                    Security scheme name.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Apr 02 02:48:51 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  2. docs_src/body_nested_models/tutorial003.py

    from typing import Set, Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: Set[str] = set()
    
    
    @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
    - 414 bytes
    - Viewed (0)
  3. docs_src/body/tutorial004.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
    
    
    app = FastAPI()
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Item, q: Union[str, None] = None):
        result = {"item_id": item_id, **item.dict()}
        if q:
            result.update({"q": q})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Jan 09 14:28:58 UTC 2024
    - 452 bytes
    - Viewed (0)
  4. tests/test_forms_single_model.py

    from pydantic import BaseModel, Field
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    class FormModel(BaseModel):
        username: str
        lastname: str
        age: Optional[int] = None
        tags: List[str] = ["foo", "bar"]
        alias_with: str = Field(alias="with", default="nothing")
    
    
    @app.post("/form/")
    def post_form(user: Annotated[FormModel, Form()]):
        return user
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Sep 13 09:51:00 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  5. guava/src/com/google/common/base/CaseFormat.java

       * Converts the specified {@code String str} from this format to the specified {@code format}. A
       * "best effort" approach is taken; if {@code str} does not conform to the assumed format, then
       * the behavior of this method is undefined but we make a reasonable effort at converting anyway.
       */
      public final String to(CaseFormat format, String str) {
        checkNotNull(format);
        checkNotNull(str);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Dec 19 20:20:14 UTC 2022
    - 6.3K bytes
    - Viewed (0)
  6. docs_src/response_model/tutorial001_py39.py

    from typing import Any, Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: list[str] = []
    
    
    @app.post("/items/", response_model=Item)
    async def create_item(item: Item) -> Any:
        return item
    
    
    @app.get("/items/", response_model=list[Item])
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Jan 07 13:45:48 UTC 2023
    - 556 bytes
    - Viewed (0)
  7. fastapi/security/utils.py

    from typing import Optional, Tuple
    
    
    def get_authorization_scheme_param(
        authorization_header_value: Optional[str],
    ) -> Tuple[str, str]:
        if not authorization_header_value:
            return "", ""
        scheme, _, param = authorization_header_value.partition(" ")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Nov 13 14:26:09 UTC 2022
    - 293 bytes
    - Viewed (0)
  8. docs_src/body_multiple_params/tutorial001.py

    from pydantic import BaseModel
    
    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 = 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}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 596 bytes
    - Viewed (0)
  9. tests/test_validate_response_recursive/app_pv2.py

    class RecursiveItem(BaseModel):
        sub_items: List["RecursiveItem"] = []
        name: str
    
    
    RecursiveItem.model_rebuild()
    
    
    class RecursiveSubitemInSubmodel(BaseModel):
        sub_items2: List["RecursiveItemViaSubmodel"] = []
        name: str
    
    
    class RecursiveItemViaSubmodel(BaseModel):
        sub_items1: List[RecursiveSubitemInSubmodel] = []
        name: str
    
    
    RecursiveSubitemInSubmodel.model_rebuild()
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  10. docs/vi/docs/python-types.md

    ```Python hl_lines="1  4"
    {!../../docs_src/python_types/tutorial009.py!}
    ```
    
    Sử dụng `Optional[str]` thay cho `str` sẽ cho phép trình soạn thảo giúp bạn phát hiện các lỗi mà bạn có thể gặp như một giá trị luôn là một `str`, trong khi thực tế nó rất có thể là `None`.
    
    `Optional[Something]` là một cách viết ngắn gọn của `Union[Something, None]`, chúng là tương đương nhau.
    
    Điều này cũng có nghĩa là trong Python 3.10, bạn có thể sử dụng `Something | None`:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 21.6K bytes
    - Viewed (0)
Back to top