Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 135 for faketime (0.1 sec)

  1. tests/test_serialize_response_dataclass.py

            {
                "name": "baz",
                "date": datetime(2021, 7, 26),
                "price": 2.0,
                "owner_ids": [1, 2, 3],
            },
        ]
    
    
    @app.get("/items/objectlist", response_model=List[Item])
    def get_objectlist():
        return [
            Item(name="foo", date=datetime(2021, 7, 26)),
            Item(name="bar", date=datetime(2021, 7, 26), price=1.0),
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 26 13:56:47 UTC 2022
    - 4.9K bytes
    - Viewed (0)
  2. docs/uk/docs/tutorial/extra-data-types.md

    * `datetime.datetime`:
        * Пайтонівський `datetime.datetime`.
        * У запитах та відповідях буде представлений як `str` в форматі ISO 8601, як: `2008-09-15T15:53:00+05:00`.
    * `datetime.date`:
        * Пайтонівський `datetime.date`.
        * У запитах та відповідях буде представлений як `str` в форматі ISO 8601, як: `2008-09-15`.
    * `datetime.time`:
        * Пайтонівський `datetime.time`.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/extra-data-types.md

    * `datetime.datetime`:
        * A Python `datetime.datetime`.
        * In requests and responses will be represented as a `str` in ISO 8601 format, like: `2008-09-15T15:53:00+05:00`.
    * `datetime.date`:
        * Python `datetime.date`.
        * In requests and responses will be represented as a `str` in ISO 8601 format, like: `2008-09-15`.
    * `datetime.time`:
        * A Python `datetime.time`.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4K bytes
    - Viewed (0)
  4. docs/zh/docs/tutorial/extra-data-types.md

        * 在请求和响应中将以 `str` 表示。
    * `datetime.datetime`:
        * 一个 Python `datetime.datetime`.
        * 在请求和响应中将表示为 ISO 8601 格式的 `str` ,比如: `2008-09-15T15:53:00+05:00`.
    * `datetime.date`:
        * Python `datetime.date`.
        * 在请求和响应中将表示为 ISO 8601 格式的 `str` ,比如: `2008-09-15`.
    * `datetime.time`:
        * 一个 Python `datetime.time`.
        * 在请求和响应中将表示为 ISO 8601 格式的 `str` ,比如:  `14:23:55.003`.
    * `datetime.timedelta`:
        * 一个 Python `datetime.timedelta`.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  5. docs_src/python_types/tutorial011_py310.py

    from datetime import datetime
    
    from pydantic import BaseModel
    
    
    class User(BaseModel):
        id: int
        name: str = "John Doe"
        signup_ts: 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
    - 461 bytes
    - Viewed (0)
  6. tests/test_jsonable_encoder.py

    from collections import deque
    from dataclasses import dataclass
    from datetime import datetime, timezone
    from decimal import Decimal
    from enum import Enum
    from pathlib import PurePath, PurePosixPath, PureWindowsPath
    from typing import Optional
    
    import pytest
    from fastapi._compat import PYDANTIC_V2, Undefined
    from fastapi.encoders import jsonable_encoder
    from pydantic import BaseModel, Field, ValidationError
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 21:56:59 UTC 2024
    - 9K bytes
    - Viewed (0)
  7. docs/de/docs/tutorial/extra-data-types.md

    * `datetime.datetime`:
        * Ein Python-`datetime.datetime`.
        * Wird in Requests und Responses als `str` im ISO 8601-Format dargestellt, etwa: `2008-09-15T15:53:00+05:00`.
    * `datetime.date`:
        * Python-`datetime.date`.
        * Wird in Requests und Responses als `str` im ISO 8601-Format dargestellt, etwa: `2008-09-15`.
    * `datetime.time`:
        * Ein Python-`datetime.time`.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  8. docs_src/extra_data_types/tutorial001.py

    from datetime import datetime, time, timedelta
    from typing import Union
    from uuid import UUID
    
    from fastapi import Body, FastAPI
    
    app = FastAPI()
    
    
    @app.put("/items/{item_id}")
    async def read_items(
        item_id: UUID,
        start_datetime: datetime = Body(),
        end_datetime: datetime = Body(),
        process_after: timedelta = Body(),
        repeat_at: Union[time, None] = Body(default=None),
    ):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Apr 19 00:11:40 UTC 2024
    - 755 bytes
    - Viewed (0)
  9. docs_src/extra_data_types/tutorial001_an.py

    from datetime import datetime, time, timedelta
    from typing import Union
    from uuid import UUID
    
    from fastapi import Body, FastAPI
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.put("/items/{item_id}")
    async def read_items(
        item_id: UUID,
        start_datetime: Annotated[datetime, Body()],
        end_datetime: Annotated[datetime, Body()],
        process_after: Annotated[timedelta, Body()],
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Apr 19 00:11:40 UTC 2024
    - 830 bytes
    - Viewed (0)
  10. docs_src/encoder/tutorial001.py

    from datetime import datetime
    from typing import Union
    
    from fastapi import FastAPI
    from fastapi.encoders import jsonable_encoder
    from pydantic import BaseModel
    
    fake_db = {}
    
    
    class Item(BaseModel):
        title: str
        timestamp: datetime
        description: Union[str, None] = None
    
    
    app = FastAPI()
    
    
    @app.put("/items/{id}")
    def update_item(id: str, item: Item):
        json_compatible_item_data = jsonable_encoder(item)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 461 bytes
    - Viewed (0)
Back to top