Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for timedelta (0.06 sec)

  1. scripts/people.py

        one_year_commenters = Counter[str]()
        authors: dict[str, Author] = {}
    
        now = datetime.now(tz=timezone.utc)
        one_month_ago = now - timedelta(days=30)
        three_months_ago = now - timedelta(days=90)
        six_months_ago = now - timedelta(days=180)
        one_year_ago = now - timedelta(days=365)
    
        for discussion in discussion_nodes:
            discussion_author_name = None
            if discussion.author:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 12.3K bytes
    - Viewed (0)
  2. docs_src/security/tutorial004_py39.py

            return False
        return user
    
    
    def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None):
        to_encode = data.copy()
        if expires_delta:
            expire = datetime.now(timezone.utc) + expires_delta
        else:
            expire = datetime.now(timezone.utc) + timedelta(minutes=15)
        to_encode.update({"exp": expire})
        encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  3. 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)
  4. docs/pt/docs/tutorial/extra-data-types.md

    * `datetime.time`:
        * O `datetime.time` do Python.
        * Em requisições e respostas será representado como uma `str` no formato ISO 8601, exemplo: `14:23:55.003`.
    * `datetime.timedelta`:
        * O `datetime.timedelta` do Python.
        * Em requisições e respostas será representado como um `float` de segundos totais.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Nov 12 16:23:57 UTC 2025
    - 3K bytes
    - Viewed (0)
  5. docs/es/docs/tutorial/extra-data-types.md

    * `datetime.time`:
        * Un `datetime.time` de Python.
        * En requests y responses se representará como un `str` en formato ISO 8601, como: `14:23:55.003`.
    * `datetime.timedelta`:
        * Un `datetime.timedelta` de Python.
        * En requests y responses se representará como un `float` de segundos totales.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 16:33:45 UTC 2025
    - 2.9K bytes
    - Viewed (0)
  6. fastapi/encoders.py

    ENCODERS_BY_TYPE: dict[type[Any], Callable[[Any], Any]] = {
        bytes: lambda o: o.decode(),
        Color: str,
        datetime.date: isoformat,
        datetime.datetime: isoformat,
        datetime.time: isoformat,
        datetime.timedelta: lambda td: td.total_seconds(),
        Decimal: decimal_encoder,
        Enum: lambda o: o.value,
        frozenset: list,
        deque: list,
        GeneratorType: list,
        IPv4Address: str,
        IPv4Interface: str,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 10.7K bytes
    - Viewed (0)
  7. docs/es/docs/tutorial/security/oauth2-jwt.md

    {* ../../docs_src/security/tutorial004_an_py310.py hl[90:107] *}
    
    ## Actualizar la *path operation* `/token` { #update-the-token-path-operation }
    
    Crea un `timedelta` con el tiempo de expiración del token.
    
    Crea un verdadero token de acceso JWT y devuélvelo.
    
    {* ../../docs_src/security/tutorial004_an_py310.py hl[118:133] *}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 16:33:45 UTC 2025
    - 11.3K bytes
    - Viewed (0)
  8. docs/pt/docs/tutorial/security/oauth2-jwt.md

    Se o token for inválido, retorne um erro HTTP imediatamente.
    
    {* ../../docs_src/security/tutorial004_an_py310.py hl[90:107] *}
    
    ## Atualize a *operação de rota* `/token` { #update-the-token-path-operation }
    
    Crie um `timedelta` com o tempo de expiração do token.
    
    Crie um token de acesso JWT real e o retorne.
    
    {* ../../docs_src/security/tutorial004_an_py310.py hl[118:133] *}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Nov 12 16:23:57 UTC 2025
    - 11.4K bytes
    - Viewed (0)
Back to top