Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 191 - 200 of 1,681 for tone (0.02 seconds)

  1. docs/ko/docs/tutorial/query-params-str-validations.md

    이 경우(`Annotated`를 사용하지 않는 경우) 함수에서 기본값 `None`을 `Query()`로 바꿔야 하므로, 이제 `Query(default=None)`로 기본값을 설정해야 합니다. (최소한 FastAPI 입장에서는) 이 인자는 해당 기본값을 정의하는 것과 같은 목적을 수행합니다.
    
    그러므로:
    
    ```Python
    q: str | None = Query(default=None)
    ```
    
    ...위 코드는 기본값이 `None`인 선택적 매개변수를 만들며, 아래와 동일합니다:
    
    
    ```Python
    q: str | None = None
    ```
    
    하지만 `Query` 버전은 이것이 쿼리 매개변수임을 명시적으로 선언합니다.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 18.7K bytes
    - Click Count (0)
  2. docs/de/docs/advanced/advanced-python-types.md

    ```Python
    say_hi(name=None)  # Das funktioniert, None ist gültig 🎉
    ```
    
    Die gute Nachricht ist: In den meisten Fällen können Sie einfach `|` verwenden, um Unions von Typen zu definieren:
    
    ```python
    def say_hi(name: str | None):
        print(f"Hey {name}!")
    ```
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Feb 14 07:57:30 GMT 2026
    - 2.3K bytes
    - Click Count (0)
  3. tests/test_request_params/test_cookie/test_optional_str.py

    # Without aliases
    
    
    @app.get("/optional-str")
    async def read_optional_str(p: Annotated[str | None, Cookie()] = None):
        return {"p": p}
    
    
    class CookieModelOptionalStr(BaseModel):
        p: str | None = None
    
    
    @app.get("/model-optional-str")
    async def read_model_optional_str(p: Annotated[CookieModelOptionalStr, Cookie()]):
        return {"p": p.p}
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 8.6K bytes
    - Click Count (0)
  4. docs_src/response_model/tutorial003_py310.py

    app = FastAPI()
    
    
    class UserIn(BaseModel):
        username: str
        password: str
        email: EmailStr
        full_name: str | None = None
    
    
    class UserOut(BaseModel):
        username: str
        email: EmailStr
        full_name: str | None = None
    
    
    @app.post("/user/", response_model=UserOut)
    async def create_user(user: UserIn) -> Any:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 431 bytes
    - Click Count (0)
  5. tests/test_security_api_key_query_optional.py

    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: str | None = Security(api_key)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: User | None = Depends(get_current_user)):
        if current_user is None:
            return {"msg": "Create an account first"}
        return current_user
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 2.1K bytes
    - Click Count (0)
  6. docs/fr/docs/advanced/advanced-python-types.md

    ```Python
    say_hi(name=None)  # Ceci fonctionne, None est valide 🎉
    ```
    
    La bonne nouvelle, c'est que, dans la plupart des cas, vous pourrez simplement utiliser `|` pour définir des unions de types :
    
    ```python
    def say_hi(name: str | None):
        print(f"Hey {name}!")
    ```
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Feb 14 08:12:41 GMT 2026
    - 2.3K bytes
    - Click Count (0)
  7. docs_src/path_operation_configuration/tutorial003_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
        tags: set[str] = set()
    
    
    @app.post(
        "/items/",
        summary="Create an item",
        description="Create an item with all the information, name, description, price, tax and a set of unique tags",
    )
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 04 12:07:26 GMT 2026
    - 457 bytes
    - Click Count (0)
  8. docs_src/schema_extra_example/tutorial002_py310.py

    from pydantic import BaseModel, Field
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str = Field(examples=["Foo"])
        description: str | None = Field(default=None, examples=["A very nice Item"])
        price: float = Field(examples=[35.4])
        tax: float | None = Field(default=None, examples=[3.2])
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Item):
        results = {"item_id": item_id, "item": item}
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 479 bytes
    - Click Count (0)
  9. tests/test_tutorial/test_body_multiple_params/test_tutorial004.py

                "price": 50.5,
                "description": None,
                "tax": None,
            },
            "user": {"username": "Dave", "full_name": None},
        }
    
    
    def test_put_missing_body(client: TestClient):
        response = client.put("/items/5")
        assert response.status_code == 422
        assert response.json() == {
            "detail": [
                {
                    "input": None,
                    "loc": [
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 10K bytes
    - Click Count (0)
  10. docs/ru/docs/tutorial/query-params-str-validations.md

    Пришло время использовать его с FastAPI. 🚀
    
    У нас была такая аннотация типа:
    
    ```Python
    q: str | None = None
    ```
    
    Мы «обернём» это в `Annotated`, и получится:
    
    ```Python
    q: Annotated[str | None] = None
    ```
    
    Обе версии означают одно и то же: `q` — параметр, который может быть `str` или `None`, и по умолчанию равен `None`.
    
    А теперь к самому интересному. 🎉
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:56:20 GMT 2026
    - 25.1K bytes
    - Click Count (0)
Back to Top