Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for decimal (0.19 sec)

  1. fastapi/params.py

                max_length=max_length,
                discriminator=discriminator,
                multiple_of=multiple_of,
                allow_nan=allow_inf_nan,
                max_digits=max_digits,
                decimal_places=decimal_places,
                **extra,
            )
            if examples is not None:
                kwargs["examples"] = examples
            if regex is not None:
                warnings.warn(
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 27.5K bytes
    - Viewed (1)
  2. fastapi/param_functions.py

            Doc(
                """
                Maximum number of allow digits for strings.
                """
            ),
        ] = _Unset,
        decimal_places: Annotated[
            Union[int, None],
            Doc(
                """
                Maximum number of decimal places allowed for numbers.
                """
            ),
        ] = _Unset,
        examples: Annotated[
            Optional[List[Any]],
            Doc(
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 62.5K bytes
    - Viewed (0)
  3. docs/pt/docs/tutorial/extra-data-types.md

    * `bytes`:
        * O `bytes` padrão do Python.
        * Em requisições e respostas será representado como uma `str`.
        * O esquema gerado vai especificar que é uma `str` com o "formato" `binary`.
    * `Decimal`:
        * O `Decimal` padrão do Python.
        * Em requisições e respostas será representado como um `float`.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 3K bytes
    - Viewed (0)
  4. docs/ru/docs/tutorial/extra-data-types.md

    * `bytes`:
        * Встроенный в Python `bytes`.
        * В запросах и ответах будет рассматриваться как `str`.
        * В сгенерированной схеме будет указано, что это `str` в формате `binary`.
    * `Decimal`:
        * Встроенный в Python `Decimal`.
        * В запросах и ответах обрабатывается так же, как и `float`.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 4.7K bytes
    - Viewed (0)
  5. fastapi/encoders.py

        results in failed round-tripping between encode and parse.
        Our Id type is a prime example of this.
    
        >>> decimal_encoder(Decimal("1.0"))
        1.0
    
        >>> decimal_encoder(Decimal("1"))
        1
        """
        if dec_value.as_tuple().exponent >= 0:  # type: ignore[operator]
            return int(dec_value)
        else:
            return float(dec_value)
    
    
    ENCODERS_BY_TYPE: Dict[Type[Any], Callable[[Any], Any]] = {
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  6. docs/uk/docs/tutorial/extra-data-types.md

    * `bytes`:
        * Стандартний Пайтонівський `bytes`.
        * У запитах і відповідях це буде оброблено як `str`.
        * Згенерована схема буде вказувати, що це `str` з "форматом" `binary`.
    * `Decimal`:
        * Стандартний Пайтонівський `Decimal`.
        * У запитах і відповідях це буде оброблено так само, як і `float`.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/extra-data-types.md

    * `bytes`:
        * Standard Python `bytes`.
        * In requests and responses will be treated as `str`.
        * The generated schema will specify that it's a `str` with `binary` "format".
    * `Decimal`:
        * Standard Python `Decimal`.
        * In requests and responses, handled the same as a `float`.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  8. docs/em/docs/tutorial/extra-data-types.md

            * 📨, `set` 🔜 🗜 `list`.
            * 🏗 🔗 🔜 ✔ 👈 `set` 💲 😍 (⚙️ 🎻 🔗 `uniqueItems`).
    * `bytes`:
        * 🐩 🐍 `bytes`.
        * 📨 & 📨 🔜 😥 `str`.
        * 🏗 🔗 🔜 ✔ 👈 ⚫️ `str` ⏮️ `binary` "📁".
    * `Decimal`:
        * 🐩 🐍 `Decimal`.
        * 📨 & 📨, 🍵 🎏 `float`.
    * 👆 💪 ✅ 🌐 ☑ Pydantic 📊 🆎 📥: <a href="https://docs.pydantic.dev/latest/concepts/types/" class="external-link" target="_blank">Pydantic 📊 🆎</a>.
    
    ## 🖼
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 2.6K bytes
    - Viewed (0)
  9. docs/ja/docs/tutorial/extra-data-types.md

            * 生成されたスキーマは`set`の値が一意であることを指定します(JSON Schemaの`uniqueItems`を使用します)。
    * `bytes`:
        * Pythonの標準的な`bytes`です。
        * リクエストとレスポンスでは`str`として扱われます。
        * 生成されたスキーマは`str`で`binary`の「フォーマット」持つことを指定します。
    * `Decimal`:
        * Pythonの標準的な`Decimal`です。
        * リクエストやレスポンスでは`float`と同じように扱います。
    
    * Pydanticの全ての有効な型はこちらで確認できます: <a href="https://docs.pydantic.dev/latest/concepts/types/" class="external-link" target="_blank">Pydantic data types</a>。
    ## 例
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  10. tests/test_multi_body_errors.py

    from decimal import Decimal
    from typing import List
    
    from dirty_equals import IsDict, IsOneOf
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel, condecimal
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        age: condecimal(gt=Decimal(0.0))  # type: ignore
    
    
    @app.post("/items/")
    def save_item_no_body(item: List[Item]):
        return {"item": item}
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.6K bytes
    - Viewed (0)
Back to top