Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 365 for NOTE (0.3 sec)

  1. docs/en/docs/how-to/async-sql-encode-databases.md

    !!! note
        Notice that as we communicate with the database using `await`, the *path operation function* is declared with `async`.
    
    ### About `{**note.dict(), "id": last_record_id}`
    
    `note` is a Pydantic `Note` object.
    
    `note.dict()` returns a `dict` with its data, something like:
    
    ```Python
    {
        "text": "Some note",
        "completed": False,
    }
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  2. docs/em/docs/tutorial/dependencies/dependencies-with-yield.md

    participant dep as Dep with yield
    participant operation as Path Operation
    participant tasks as Background tasks
    
        Note over client,tasks: Can raise exception for dependency, handled after response is sent
        Note over client,operation: Can raise HTTPException and can change the response
        client ->> dep: Start request
        Note over dep: Run code up to yield
        opt raise
            dep -->> handler: Raise HTTPException
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  3. docs/zh/docs/advanced/async-sql-databases.md

    ```
    
    !!! Note "笔记"
    
        注意,本例与数据库通信时使用 `await`,因此要把*路径操作函数*声明为异步函数(`asnyc`)。
    
    ### 关于 `{**note.dict(), "id": last_record_id}`
    
    `note` 是 Pydantic `Note` 对象:
    
    `note.dict()` 返回包含如下数据的**字典**:
    
    ```Python
    {
        "text": "Some note",
        "completed": False,
    }
    ```
    
    但它不包含 `id` 字段。
    
    因此要新建一个包含 `note.dict()` 键值对的**字典**:
    
    ```Python
    {**note.dict()}
    ```
    
    Plain Text
    - Registered: Sun Mar 31 07:19:09 GMT 2024
    - Last Modified: Sat Mar 30 22:44:40 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  4. docs/en/docs/advanced/using-request-directly.md

    {!../../../docs_src/using_request_directly/tutorial001.py!}
    ```
    
    By declaring a *path operation function* parameter with the type being the `Request` **FastAPI** will know to pass the `Request` in that parameter.
    
    !!! tip
        Note that in this case, we are declaring a path parameter beside the request parameter.
    
        So, the path parameter will be extracted, validated, converted to the specified type and annotated with OpenAPI.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 29 14:02:58 GMT 2020
    - 2.3K bytes
    - Viewed (0)
  5. docs/pt/docs/tutorial/query-params-str-validations.md

    ```
    
    O parâmetro de consulta `q` é do tipo `Union[str, None]`, o que significa que é do tipo `str` mas que também pode ser `None`, e de fato, o valor padrão é `None`, então o FastAPI saberá que não é obrigatório.
    
    !!! note "Observação"
        O FastAPI saberá que o valor de `q` não é obrigatório por causa do valor padrão `= None`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 9.3K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_async_sql_databases/test_tutorial001.py

    @needs_pydanticv1
    def test_create_read(app: FastAPI):
        with TestClient(app) as client:
            note = {"text": "Foo bar", "completed": False}
            response = client.post("/notes/", json=note)
            assert response.status_code == 200, response.text
            data = response.json()
            assert data["text"] == note["text"]
            assert data["completed"] == note["completed"]
            assert "id" in data
            response = client.get("/notes/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Oct 18 12:36:40 GMT 2023
    - 6K bytes
    - Viewed (0)
  7. docs/zh/docs/tutorial/request-files.md

    ```Python
    contents = await myfile.read()
    ```
    
    在普通 `def` *路径操作函数*  内,则可以直接访问 `UploadFile.file`,例如:
    
    ```Python
    contents = myfile.file.read()
    ```
    
    !!! note "`async` 技术细节"
    
        使用 `async` 方法时,**FastAPI** 在线程池中执行文件方法,并 `await` 操作完成。
    
    !!! note "Starlette 技术细节"
    
        **FastAPI** 的 `UploadFile` 直接继承自 **Starlette** 的 `UploadFile`,但添加了一些必要功能,使之与 **Pydantic** 及 FastAPI 的其它部件兼容。
    
    ## 什么是 「表单数据」
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 6.9K bytes
    - Viewed (0)
  8. docs/pt/docs/advanced/templates.md

    {!../../../docs_src/templates/tutorial001.py!}
    ```
    
    !!! note
        Antes do FastAPI 0.108.0, Starlette 0.29.0, `name` era o primeiro parâmetro.
    
        Além disso, em versões anteriores, o objeto `request` era passado como parte dos pares chave-valor no "context" dict para o Jinja2.
    
    
    !!! tip "Dica"
        Ao declarar `response_class=HTMLResponse`, a documentação entenderá que a resposta será HTML.
    
    
    !!! note "Detalhes Técnicos"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 28 04:05:17 GMT 2024
    - 3.4K bytes
    - Viewed (0)
  9. docs/ko/docs/tutorial/middleware.md

    * 미들웨어는 응용 프로그램으로 오는 **요청**를 가져옵니다.
    * **요청** 또는 다른 필요한 코드를 실행 시킬 수 있습니다.
    * **요청**을 응용 프로그램의 *경로 작동*으로 전달하여 처리합니다.
    * 애플리케이션의 *경로 작업*에서 생성한 **응답**를 받습니다.
    * **응답** 또는 다른 필요한 코드를 실행시키는 동작을 할 수 있습니다.
    * **응답**를 반환합니다.
    
    !!! note "기술 세부사항"
        만약 `yield`를 사용한 의존성을 가지고 있다면, 미들웨어가 실행되고 난 후에 exit이 실행됩니다.
    
        만약 (나중에 문서에서 다룰) 백그라운드 작업이 있다면, 모든 미들웨어가 실행되고 *난 후에* 실행됩니다.
    
    ## 미들웨어 만들기
    
    미들웨어를 작성하기 위해서 함수 상단에 `@app.middleware("http")` 데코레이터를 사용할 수 있습니다.
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Jan 31 14:35:27 GMT 2024
    - 3.4K bytes
    - Viewed (0)
  10. docs/ru/docs/tutorial/request-files.md

    ```Python
    contents = myfile.file.read()
    ```
    
    !!! note "Технические детали `async`"
        При использовании методов `async` **FastAPI** запускает файловые методы в пуле потоков и ожидает их.
    
    !!! note "Технические детали Starlette"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 15.4K bytes
    - Viewed (0)
Back to top