Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 26 for jsonable (0.07 seconds)

  1. docs/ja/docs/tutorial/encoder.md

    データ型(Pydanticモデルのような)をJSONと互換性のあるもの(`dict`や`list`など)に変換する必要があるケースがあります。
    
    例えば、データベースに保存する必要がある場合です。
    
    そのために、**FastAPI** は`jsonable_encoder()`関数を提供しています。
    
    ## `jsonable_encoder`の使用 { #using-the-jsonable-encoder }
    
    JSON互換のデータのみを受信するデータベース`fake_db`があるとしましょう。
    
    例えば、`datetime`オブジェクトはJSONと互換性がないので、受け取られません。
    
    そのため、`datetime`オブジェクトは[ISO形式](https://en.wikipedia.org/wiki/ISO_8601)のデータを含む`str`に変換されなければなりません。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 1.8K bytes
    - Click Count (0)
  2. docs/ko/docs/tutorial/encoder.md

    데이터 유형(예: Pydantic 모델)을 JSON과 호환되는 형태(예: `dict`, `list` 등)로 변환해야 하는 경우가 있습니다.
    
    예를 들면, 데이터베이스에 저장해야 하는 경우입니다.
    
    이를 위해, **FastAPI**에서는 `jsonable_encoder()` 함수를 제공합니다.
    
    ## `jsonable_encoder` 사용 { #using-the-jsonable-encoder }
    
    JSON 호환 가능 데이터만 수신하는 `fake_db` 데이터베이스가 존재한다고 가정하겠습니다.
    
    예를 들면, `datetime` 객체는 JSON과 호환되지 않으므로 이 데이터베이스는 이를 받지 않습니다.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 1.8K bytes
    - Click Count (0)
  3. docs/en/docs/tutorial/encoder.md

    For example, if you need to store it in a database.
    
    For that, **FastAPI** provides a `jsonable_encoder()` function.
    
    ## Using the `jsonable_encoder` { #using-the-jsonable-encoder }
    
    Let's imagine that you have a database `fake_db` that only receives JSON compatible data.
    
    For example, it doesn't receive `datetime` objects, as those are not compatible with JSON.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 1.6K bytes
    - Click Count (0)
  4. docs/en/docs/advanced/response-directly.md

    It also gives you a lot of **responsibility**. You have to make sure that the data you return is correct, in the correct format, that it can be serialized, etc.
    
    ## Using the `jsonable_encoder` in a `Response` { #using-the-jsonable-encoder-in-a-response }
    
    Because **FastAPI** doesn't make any changes to a `Response` you return, you have to make sure its contents are ready for it.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 4K bytes
    - Click Count (0)
  5. docs/zh-hant/docs/tutorial/encoder.md

    # JSON 相容編碼器 { #json-compatible-encoder }
    
    在某些情況下,你可能需要將某種資料型別(例如 Pydantic 模型)轉換為與 JSON 相容的類型(例如 `dict`、`list` 等)。
    
    例如,當你需要把它儲存在資料庫中。
    
    為此,**FastAPI** 提供了 `jsonable_encoder()` 函式。
    
    ## 使用 `jsonable_encoder` { #using-the-jsonable-encoder }
    
    想像你有一個只接受與 JSON 相容資料的資料庫 `fake_db`。
    
    例如,它不接受 `datetime` 物件,因為那與 JSON 不相容。
    
    因此,必須將 `datetime` 物件轉為一個以 [ISO 格式](https://en.wikipedia.org/wiki/ISO_8601) 表示資料的 `str`。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 1.5K bytes
    - Click Count (0)
  6. docs/zh/docs/tutorial/encoder.md

    # JSON 兼容编码器 { #json-compatible-encoder }
    
    在某些情况下,您可能需要将数据类型(如Pydantic模型)转换为与JSON兼容的数据类型(如`dict`、`list`等)。
    
    比如,如果您需要将其存储在数据库中。
    
    对于这种要求, **FastAPI**提供了`jsonable_encoder()`函数。
    
    ## 使用`jsonable_encoder` { #using-the-jsonable-encoder }
    
    让我们假设你有一个数据库名为`fake_db`,它只能接收与JSON兼容的数据。
    
    例如,它不接收`datetime`这类的对象,因为这些对象与JSON不兼容。
    
    因此,`datetime`对象必须转换为包含[ISO 格式](https://en.wikipedia.org/wiki/ISO_8601)的`str`类型对象。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 1.5K bytes
    - Click Count (0)
  7. docs/ru/docs/tutorial/encoder.md

    Например, если необходимо хранить его в базе данных.
    
    Для этого **FastAPI** предоставляет функцию `jsonable_encoder()`.
    
    ## Использование `jsonable_encoder` { #using-the-jsonable-encoder }
    
    Представим, что у вас есть база данных `fake_db`, которая принимает только JSON-совместимые данные.
    
    Например, она не принимает объекты `datetime`, так как они не совместимы с JSON.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:56:20 GMT 2026
    - 2.6K bytes
    - Click Count (0)
  8. docs/de/docs/tutorial/encoder.md

    Zum Beispiel, wenn Sie es in einer Datenbank speichern möchten.
    
    Dafür bietet **FastAPI** eine Funktion `jsonable_encoder()`.
    
    ## `jsonable_encoder` verwenden { #using-the-jsonable-encoder }
    
    Stellen wir uns vor, Sie haben eine Datenbank `fake_db`, die nur JSON-kompatible Daten entgegennimmt.
    
    Sie akzeptiert zum Beispiel keine `datetime`-Objekte, da die nicht kompatibel mit JSON sind.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:58:09 GMT 2026
    - 1.8K bytes
    - Click Count (0)
  9. docs/es/docs/tutorial/encoder.md

    Por ejemplo, si necesitas almacenarlo en una base de datos.
    
    Para eso, **FastAPI** proporciona una función `jsonable_encoder()`.
    
    ## Usando el `jsonable_encoder` { #using-the-jsonable-encoder }
    
    Imaginemos que tienes una base de datos `fake_db` que solo recibe datos compatibles con JSON.
    
    Por ejemplo, no recibe objetos `datetime`, ya que no son compatibles con JSON.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:15:55 GMT 2026
    - 1.7K bytes
    - Click Count (0)
  10. docs/uk/docs/tutorial/encoder.md

    Наприклад, якщо вам потрібно зберегти це в базі даних.
    
    Для цього **FastAPI** надає функцію `jsonable_encoder()`.
    
    ## Використання `jsonable_encoder` { #using-the-jsonable-encoder }
    
    Давайте уявимо, що у вас є база даних `fake_db`, яка приймає лише дані, сумісні з JSON.
    
    Наприклад, вона не приймає об'єкти типу `datetime`, оскільки вони не сумісні з JSON.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:27:41 GMT 2026
    - 2.4K bytes
    - Click Count (0)
Back to Top