- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 37 for Datetime (0.05 sec)
-
docs/es/docs/tutorial/extra-data-types.md
* `datetime.datetime`: * Un `datetime.datetime` de Python. * En requests y responses se representará como un `str` en formato ISO 8601, como: `2008-09-15T15:53:00+05:00`. * `datetime.date`: * `datetime.date` de Python. * En requests y responses se representará como un `str` en formato ISO 8601, como: `2008-09-15`. * `datetime.time`: * Un `datetime.time` de Python.Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Dec 16 16:33:45 UTC 2025 - 2.9K bytes - Viewed (0) -
tests/test_serialize_response_dataclass.py
from datetime import datetime from typing import Optional from fastapi import FastAPI from fastapi.testclient import TestClient app = FastAPI() @dataclass class Item: name: str date: datetime price: Optional[float] = None owner_ids: Optional[list[int]] = None @app.get("/items/valid", response_model=Item) def get_valid():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 4.9K bytes - Viewed (0) -
tests/test_datetime_custom_encoder.py
from datetime import datetime, timezone from fastapi import FastAPI from fastapi.testclient import TestClient from pydantic import BaseModel def test_pydanticv2(): from pydantic import field_serializer class ModelWithDatetimeField(BaseModel): dt_field: datetime @field_serializer("dt_field") def serialize_datetime(self, dt_field: datetime):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 12:54:56 UTC 2025 - 817 bytes - Viewed (0) -
docs_src/response_directly/tutorial001_py310.py
from datetime import datetime from fastapi import FastAPI from fastapi.encoders import jsonable_encoder from fastapi.responses import JSONResponse from pydantic import BaseModel class Item(BaseModel): title: str timestamp: datetime description: 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 Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 10 08:55:32 UTC 2025 - 474 bytes - Viewed (0) -
tests/test_jsonable_encoder.py
import warnings from collections import deque from dataclasses import dataclass from datetime import datetime, timezone from decimal import Decimal from enum import Enum from math import isinf, isnan from pathlib import PurePath, PurePosixPath, PureWindowsPath from typing import Optional, TypedDict import pytest from fastapi._compat import Undefined from fastapi.encoders import jsonable_encoder
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 12:54:56 UTC 2025 - 9.2K bytes - Viewed (0) -
docs_src/extra_data_types/tutorial001_py39.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 Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 755 bytes - Viewed (0) -
scripts/contributors.py
nodes: list[ReviewNode] class PullRequestNode(BaseModel): number: int labels: Labels author: Author | None = None title: str createdAt: datetime lastEditedAt: datetime | None = None updatedAt: datetime | None = None state: str reviews: Reviews class PullRequestEdge(BaseModel): cursor: str node: PullRequestNode class PullRequests(BaseModel):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Dec 16 12:34:01 UTC 2025 - 8.6K bytes - Viewed (0) -
docs_src/encoder/tutorial001_py39.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 Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 461 bytes - Viewed (0) -
docs_src/response_directly/tutorial001_py39.py
from datetime import datetime from typing import Union from fastapi import FastAPI from fastapi.encoders import jsonable_encoder from fastapi.responses import JSONResponse from pydantic import BaseModel 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):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 505 bytes - Viewed (0) -
docs_src/openapi_webhooks/tutorial001_py39.py
from datetime import datetime from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Subscription(BaseModel): username: str monthly_fee: float start_date: datetime @app.webhooks.post("new-subscription") def new_subscription(body: Subscription): """ When a new user subscribes to your service we'll send you a POST request with this
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 550 bytes - Viewed (0)