Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 54 for DateTime (0.2 sec)

  1. 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),
    ):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 755 bytes
    - Viewed (0)
  2. docs_src/extra_data_types/tutorial001_py310.py

    from datetime import datetime, time, timedelta
    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: time | None = Body(default=None),
    ):
        start_process = start_datetime + process_after
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 724 bytes
    - Viewed (0)
  3. docs_src/extra_data_types/tutorial001_an_py310.py

    from datetime import datetime, time, timedelta
    from typing import Annotated
    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: Annotated[datetime, Body()],
        end_datetime: Annotated[datetime, Body()],
        process_after: Annotated[timedelta, Body()],
        repeat_at: Annotated[time | None, Body()] = None,
    ):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 788 bytes
    - Viewed (0)
  4. 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()],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 830 bytes
    - Viewed (0)
  5. tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py310.py

                        "properties": {
                            "start_datetime": {
                                "title": "Start Datetime",
                                "type": "string",
                                "format": "date-time",
                            },
                            "end_datetime": {
                                "title": "End Datetime",
                                "type": "string",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 7K bytes
    - Viewed (0)
  6. tests/test_jsonable_encoder.py

        }
    
    
    @needs_pydanticv1
    def test_custom_encoders():
        class safe_datetime(datetime):
            pass
    
        class MyModel(BaseModel):
            dt_field: safe_datetime
    
        instance = MyModel(dt_field=safe_datetime.now())
    
        encoded_instance = jsonable_encoder(
            instance, custom_encoder={safe_datetime: lambda o: o.isoformat()}
        )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  7. docs_src/extra_data_types/tutorial001_an_py39.py

    from datetime import datetime, time, timedelta
    from typing import Annotated, 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: Annotated[datetime, Body()],
        end_datetime: Annotated[datetime, Body()],
        process_after: Annotated[timedelta, Body()],
        repeat_at: Annotated[Union[time, None], Body()] = None,
    ):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 801 bytes
    - Viewed (0)
  8. tests/test_tutorial/test_extra_data_types/test_tutorial001.py

                        "properties": {
                            "start_datetime": {
                                "title": "Start Datetime",
                                "type": "string",
                                "format": "date-time",
                            },
                            "end_datetime": {
                                "title": "End Datetime",
                                "type": "string",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_extra_data_types/test_tutorial001_an.py

                        "properties": {
                            "start_datetime": {
                                "title": "Start Datetime",
                                "type": "string",
                                "format": "date-time",
                            },
                            "end_datetime": {
                                "title": "End Datetime",
                                "type": "string",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py39.py

                        "properties": {
                            "start_datetime": {
                                "title": "Start Datetime",
                                "type": "string",
                                "format": "date-time",
                            },
                            "end_datetime": {
                                "title": "End Datetime",
                                "type": "string",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 7K bytes
    - Viewed (0)
Back to top