- Sort Score
- Result 10 results
- Languages All
Results 881 - 890 of 1,076 for Fstr (0.03 sec)
-
docs/es/docs/advanced/security/oauth2-scopes.md
Para eso, actualizamos el modelo de Pydantic `TokenData` con una nueva propiedad `scopes`. Al validar los datos con Pydantic podemos asegurarnos de que tenemos, por ejemplo, exactamente una `list` de `str` con los scopes y un `str` con el `username`. En lugar de, por ejemplo, un `dict`, o algo más, ya que podría romper la aplicación en algún punto posterior, haciéndolo un riesgo de seguridad.
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 10:15:01 UTC 2025 - 14.2K bytes - Viewed (0) -
tests/test_query_cookie_header_model_extra_params.py
from fastapi import Cookie, FastAPI, Header, Query from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() class Model(BaseModel): param: str model_config = {"extra": "allow"} @app.get("/query") async def query_model_with_extra(data: Model = Query()): return data @app.get("/header") async def header_model_with_extra(data: Model = Header()): return data
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 2.3K bytes - Viewed (0) -
tests/test_dependency_after_yield_websockets.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 2K bytes - Viewed (0) -
src/main/java/jcifs/smb/SmbRandomAccessFile.java
public final void writeUTF(final String str) throws SmbException { final int len = str.length(); int ch, size = 0; byte[] dst; for (int i = 0; i < len; i++) { ch = str.charAt(i); size += ch > 0x07F ? ch > 0x7FF ? 3 : 2 : 1; } dst = new byte[size]; writeShort(size); Encdec.enc_utf8(str, dst, 0, size); write(dst, 0, size);
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Sat Aug 16 01:32:48 UTC 2025 - 18.8K bytes - Viewed (0) -
docs/pt/docs/advanced/security/oauth2-scopes.md
Para isso, nós atualizamos o modelo Pydantic `TokenData` com a nova propriedade `scopes`. Ao validar os dados com o Pydantic nós podemos garantir que temos, por exemplo, exatamente uma `list` de `str` com os escopos e uma `str` com o `username`. No lugar de, por exemplo, um `dict`, ou alguma outra coisa, que poderia quebrar a aplicação em algum lugar mais tarde, tornando isso um risco de segurança.
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Nov 12 16:23:57 UTC 2025 - 14.9K bytes - Viewed (0) -
docs/ru/docs/advanced/security/oauth2-scopes.md
Для этого мы обновляем Pydantic‑модель `TokenData`, добавляя новое свойство `scopes`. Валидируя данные с помощью Pydantic, мы можем удостовериться, что у нас, например, именно `list` из `str` со scopes и `str` с `username`. А не, скажем, `dict` или что‑то ещё — ведь это могло бы где‑то позже сломать приложение и создать риск для безопасности.
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Sep 30 11:37:11 UTC 2025 - 20.7K bytes - Viewed (0) -
docs/zh/docs/features.md
编写带有类型标注的标准 Python: ```Python from datetime import date from pydantic import BaseModel # Declare a variable as a str # and get editor support inside the function def main(user_id: str): return user_id # A Pydantic model class User(BaseModel): id: int name: str joined: date ``` 可以像这样来使用: ```Python my_user: User = User(id=3, name="John Doe", joined="2018-07-19")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Oct 11 17:48:49 UTC 2025 - 8.9K bytes - Viewed (0) -
tests/test_union_body.py
from typing import Optional, Union from fastapi import FastAPI from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: Optional[str] = None class OtherItem(BaseModel): price: int @app.post("/items/") def save_union_body(item: Union[OtherItem, Item]): return {"item": item} client = TestClient(app)
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 4.3K bytes - Viewed (0) -
tests/test_generate_unique_id_function.py
return f"bar_{route.name}" def custom_generate_unique_id3(route: APIRoute): return f"baz_{route.name}" class Item(BaseModel): name: str price: float class Message(BaseModel): title: str description: str def test_top_level_generate_unique_id(): app = FastAPI(generate_unique_id_function=custom_generate_unique_id) router = APIRouter()Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 66.7K bytes - Viewed (0) -
docs/es/docs/tutorial/response-model.md
{* ../../docs_src/response_model/tutorial004_py310.py hl[9,11:12] *} * `description: Union[str, None] = None` (o `str | None = None` en Python 3.10) tiene un valor por defecto de `None`. * `tax: float = 10.5` tiene un valor por defecto de `10.5`. * `tags: List[str] = []` tiene un valor por defecto de una list vacía: `[]`. pero podrías querer omitirlos del resultado si no fueron en realidad almacenados.Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 17.7K bytes - Viewed (0)