Search Options

Results per page
Sort
Preferred Languages
Advance

Results 581 - 590 of 1,074 for Str (0.02 sec)

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

    В Python версии 3.9 это будет выглядеть так:
    
    ```Python
    my_list: list[str]
    ```
    
    В версиях Python до 3.9 это будет выглядеть так:
    
    ```Python
    from typing import List
    
    my_list: List[str]
    ```
    
    Это всё стандартный синтаксис Python для объявления типов.
    
    Используйте этот же стандартный синтаксис для атрибутов модели с внутренними типами.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 14.8K bytes
    - Viewed (0)
  2. docs/ko/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's exotic types</a> 문서를 확인하세요. 다음 장에서 몇가지 예제를 볼 수 있습니다.
    
    예를 들어 `Image` 모델 안에 `url` 필드를 `str` 대신 Pydantic의 `HttpUrl`로 선언할 수 있습니다:
    
    ```Python hl_lines="4  10"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/body-nested-models.md

    * Pass the internal type(s) as "type parameters" using square brackets: `[` and `]`
    
    In Python 3.9 it would be:
    
    ```Python
    my_list: list[str]
    ```
    
    In versions of Python before 3.9, it would be:
    
    ```Python
    from typing import List
    
    my_list: List[str]
    ```
    
    That's all standard Python syntax for type declarations.
    
    Use that same standard syntax for model attributes with internal types.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  4. docs_src/dependencies/tutorial001_02_an_py310.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    async def common_parameters(q: str | None = None, skip: int = 0, limit: int = 100):
        return {"q": q, "skip": skip, "limit": limit}
    
    
    CommonsDep = Annotated[dict, Depends(common_parameters)]
    
    
    @app.get("/items/")
    async def read_items(commons: CommonsDep):
        return commons
    
    
    @app.get("/users/")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 447 bytes
    - Viewed (0)
  5. docs_src/python_types/tutorial011_py39.py

    from datetime import datetime
    from typing import Union
    
    from pydantic import BaseModel
    
    
    class User(BaseModel):
        id: int
        name: str = "John Doe"
        signup_ts: Union[datetime, None] = None
        friends: list[int] = []
    
    
    external_data = {
        "id": "123",
        "signup_ts": "2017-06-01 12:22",
        "friends": [1, "2", b"3"],
    }
    user = User(**external_data)
    print(user)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Sep 02 15:56:35 UTC 2023
    - 492 bytes
    - Viewed (0)
  6. docs_src/query_param_models/tutorial001.py

    app = FastAPI()
    
    
    class FilterParams(BaseModel):
        limit: int = Field(100, gt=0, le=100)
        offset: int = Field(0, ge=0)
        order_by: Literal["created_at", "updated_at"] = "created_at"
        tags: List[str] = []
    
    
    @app.get("/items/")
    async def read_items(filter_query: FilterParams = Query()):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 457 bytes
    - Viewed (0)
  7. docs_src/query_param_models/tutorial002_pv1_an_py310.py

        class Config:
            extra = "forbid"
    
        limit: int = Field(100, gt=0, le=100)
        offset: int = Field(0, ge=0)
        order_by: Literal["created_at", "updated_at"] = "created_at"
        tags: list[str] = []
    
    
    @app.get("/items/")
    async def read_items(filter_query: Annotated[FilterParams, Query()]):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 487 bytes
    - Viewed (0)
  8. docs_src/query_params_str_validations/tutorial005_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Annotated[str, Query(min_length=3)] = "fixedquery"):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 309 bytes
    - Viewed (0)
  9. docs_src/query_params_str_validations/tutorial007_py310.py

    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: str | None = Query(default=None, title="Query string", min_length=3),
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 304 bytes
    - Viewed (0)
  10. docs_src/query_params_str_validations/tutorial002_an_py310.py

    from typing import Annotated
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Annotated[str | None, Query(max_length=50)] = None):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 309 bytes
    - Viewed (0)
Back to top