- Sort Score
- Num 10 results
- Language All
Results 941 - 950 of 2,110 for py (0.26 seconds)
-
docs/zh-hant/docs/tutorial/extra-models.md
同樣地,你可以將回應宣告為物件的 `list`。 為此,使用標準的 Python `list`: {* ../../docs_src/extra_models/tutorial004_py310.py hl[18] *} ## 以任意 `dict` 作為回應 { #response-with-arbitrary-dict } 你也可以用一般的任意 `dict` 宣告回應,只需指定鍵和值的型別,而不必使用 Pydantic 模型。 當你事先不知道可用的欄位/屬性名稱(定義 Pydantic 模型所需)時,這很實用。 此時可使用 `dict`: {* ../../docs_src/extra_models/tutorial005_py310.py hl[6] *} ## 重點回顧 { #recap } 依情境使用多個 Pydantic 模型並靈活繼承。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 6.3K bytes - Click Count (0) -
docs/zh/docs/advanced/stream-data.md
{* ../../docs_src/stream_data/tutorial002_py310.py ln[6,19:20] hl[20] *} 然后你可以在*路径操作函数*中通过 `response_class=PNGStreamingResponse` 使用这个新类: {* ../../docs_src/stream_data/tutorial002_py310.py ln[23:27] hl[23] *} ### 模拟文件 { #simulate-a-file } 在这个示例中,我们用 `io.BytesIO` 模拟了一个文件,它是只驻留在内存中的类文件对象,但提供相同的接口。 例如,我们可以像对文件那样迭代它来消费其内容。 {* ../../docs_src/stream_data/tutorial002_py310.py ln[1:27] hl[3,12:13,25] *} /// note | 技术细节Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:29:48 GMT 2026 - 5.2K bytes - Click Count (0) -
docs/zh-hant/docs/how-to/configure-swagger-ui.md
但你可以將 `syntaxHighlight` 設為 `False` 來停用它: {* ../../docs_src/configure_swagger_ui/tutorial001_py310.py hl[3] *} ...然後 Swagger UI 就不會再顯示語法醒目提示: <img src="/img/tutorial/extending-openapi/image03.png"> ## 更換主題 { #change-the-theme } 同樣地,你可以用鍵 `"syntaxHighlight.theme"` 設定語法醒目提示主題(注意中間有一個點): {* ../../docs_src/configure_swagger_ui/tutorial002_py310.py hl[3] *} 這個設定會變更語法醒目提示的配色主題: <img src="/img/tutorial/extending-openapi/image04.png">Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 2.7K bytes - Click Count (0) -
docs/ko/docs/tutorial/security/get-current-user.md
{* ../../docs_src/security/tutorial001_an_py310.py hl[12] *} 하지만 이는 여전히 그다지 유용하지 않습니다. 현재 사용자를 제공하도록 해봅시다. ## 사용자 모델 생성하기 { #create-a-user-model } 먼저 Pydantic 사용자 모델을 만들어 봅시다. Pydantic을 사용해 본문을 선언하는 것과 같은 방식으로, 다른 곳에서도 어디서든 사용할 수 있습니다: {* ../../docs_src/security/tutorial002_an_py310.py hl[5,12:6] *} ## `get_current_user` 의존성 생성하기 { #create-a-get-current-user-dependency }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 14 08:57:01 GMT 2026 - 4.9K bytes - Click Count (0) -
docs/en/docs/tutorial/security/get-current-user.md
{* ../../docs_src/security/tutorial001_an_py310.py hl[12] *} But that is still not that useful. Let's make it give us the current user. ## Create a user model { #create-a-user-model } First, let's create a Pydantic user model. The same way we use Pydantic to declare bodies, we can use it anywhere else: {* ../../docs_src/security/tutorial002_an_py310.py hl[5,12:6] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 4K bytes - Click Count (0) -
docs/zh/docs/python-types.md
## 动机 { #motivation } 让我们从一个简单的例子开始: {* ../../docs_src/python_types/tutorial001_py310.py *} 运行这个程序会输出: ``` John Doe ``` 这个函数做了下面这些事情: * 接收 `first_name` 和 `last_name`。 * 通过 `title()` 将每个参数的第一个字母转换为大写。 * 用一个空格将它们<dfn title="把它们合在一起成为一个,内容一个接在另一个后面。">拼接</dfn>起来。 {* ../../docs_src/python_types/tutorial001_py310.py hl[2] *} ### 修改它 { #edit-it } 这是一个非常简单的程序。 但现在想象你要从零开始写它。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 10.6K bytes - Click Count (0) -
docs/en/docs/how-to/custom-request-and-route.md
{* ../../docs_src/custom_request_and_route/tutorial002_an_py310.py hl[14,16] *} If an exception occurs, the`Request` instance will still be in scope, so we can read and make use of the request body when handling the error: {* ../../docs_src/custom_request_and_route/tutorial002_an_py310.py hl[17:19] *} ## Custom `APIRoute` class in a router { #custom-apiroute-class-in-a-router }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4.4K bytes - Click Count (0) -
docs/ja/docs/how-to/extending-openapi.md
まず、通常どおりに **FastAPI** アプリケーションを実装します: {* ../../docs_src/extending_openapi/tutorial001_py310.py hl[1,4,7:9] *} ### OpenAPI スキーマの生成 { #generate-the-openapi-schema } 次に、`custom_openapi()` 関数内で同じユーティリティ関数を使って OpenAPI スキーマを生成します: {* ../../docs_src/extending_openapi/tutorial001_py310.py hl[2,15:21] *} ### OpenAPI スキーマの変更 { #modify-the-openapi-schema }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 3.9K bytes - Click Count (0) -
docs/en/docs/advanced/testing-events.md
{* ../../docs_src/app_testing/tutorial004_py310.py hl[9:15,18,27:28,30:32,41:43] *} You can read more details about the ["Running lifespan in tests in the official Starlette documentation site."](https://www.starlette.dev/lifespan/#running-lifespan-in-tests) For the deprecated `startup` and `shutdown` events, you can use the `TestClient` as follows:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 628 bytes - Click Count (0) -
scripts/tests/test_translation_fixer/test_code_includes/data/translated_doc_number_lt.md
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 08:08:04 GMT 2026 - 240 bytes - Click Count (0)