Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 52 for defaults (0.2 sec)

  1. docs/en/docs/tutorial/response-model.md

    * `tax: float = 10.5` has a default of `10.5`.
    * `tags: List[str] = []` has a default of an empty list: `[]`.
    
    but you might want to omit them from the result if they were not actually stored.
    
    For example, if you have models with many optional attributes in a NoSQL database, but you don't want to send very long JSON responses full of default values.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.9K bytes
    - Viewed (0)
  2. docs/en/docs/alternatives.md

    They are, more or less, at opposite ends, complementing each other.
    
    Requests has a very simple and intuitive design, it's very easy to use, with sensible defaults. But at the same time, it's very powerful and customizable.
    
    That's why, as said in the official website:
    
    > Requests is one of the most downloaded Python packages of all time
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23.2K bytes
    - Viewed (0)
  3. fastapi/encoders.py

                exclude_none=exclude_none,
                exclude_defaults=exclude_defaults,
            )
            if "__root__" in obj_dict:
                obj_dict = obj_dict["__root__"]
            return jsonable_encoder(
                obj_dict,
                exclude_none=exclude_none,
                exclude_defaults=exclude_defaults,
                # TODO: remove when deprecating Pydantic v1
                custom_encoder=encoders,
    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)
  4. pyproject.toml

        "B",  # flake8-bugbear
        "C4",  # flake8-comprehensions
        "UP",  # pyupgrade
    ]
    ignore = [
        "E501",  # line too long, handled by black
        "B008",  # do not perform function calls in argument defaults
        "C901",  # too complex
        "W191",  # indentation contains tabs
    ]
    
    [tool.ruff.lint.per-file-ignores]
    "__init__.py" = ["F401"]
    "docs_src/dependencies/tutorial007.py" = ["F821"]
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  5. docs/en/docs/css/termynal.css

    }
    
    a[data-terminal-control] {
        text-align: right;
        display: block;
        color: #aebbff;
    }
    
    [data-ty] {
        display: block;
        line-height: 2;
    }
    
    [data-ty]:before {
        /* Set up defaults and ensure empty lines are displayed. */
        content: '';
        display: inline-block;
        vertical-align: middle;
    }
    
    [data-ty="input"]:before,
    [data-ty-prompt]:before {
        margin-right: 0.75em;
    CSS
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  6. docs/en/docs/release-notes.md

    @app.get("/items/{item_id}")
    def main(
        item_id: int = Path(default=..., gt=0),
        query: str = Query(default=..., max_length=10),
        session: str = Cookie(default=..., min_length=3),
        x_trace: str = Header(default=..., title="Tracing header"),
    ):
        return {"message": "Hello World"}
    ```
    
    ...all these parameters are required because the default value is `...` (Ellipsis).
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 03 23:25:42 GMT 2024
    - 388.1K bytes
    - Viewed (1)
  7. tests/test_jsonable_encoder.py

        assert jsonable_encoder(model) == {"Foo": "Bar"}
    
    
    def test_encode_model_with_default():
        model = ModelWithDefault(foo="foo", bar="bar")
        assert jsonable_encoder(model) == {"foo": "foo", "bar": "bar", "bla": "bla"}
        assert jsonable_encoder(model, exclude_unset=True) == {"foo": "foo", "bar": "bar"}
        assert jsonable_encoder(model, exclude_defaults=True) == {"foo": "foo"}
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  8. fastapi/params.py

            json_schema_extra: Union[Dict[str, Any], None] = None,
            **extra: Any,
        ):
            assert default is ..., "Path parameters cannot have a default value"
            self.in_ = self.in_
            super().__init__(
                default=default,
                default_factory=default_factory,
                annotation=annotation,
                alias=alias,
                alias_priority=alias_priority,
    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)
  9. fastapi/param_functions.py

            item_id: Annotated[int, Path(title="The ID of the item to get")],
        ):
            return {"item_id": item_id}
        ```
        """
        return params.Path(
            default=default,
            default_factory=default_factory,
            alias=alias,
            alias_priority=alias_priority,
            validation_alias=validation_alias,
            serialization_alias=serialization_alias,
            title=title,
    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)
  10. fastapi/utils.py

        Create a new response field. Raises if type_ is invalid.
        """
        class_validators = class_validators or {}
        if PYDANTIC_V2:
            field_info = field_info or FieldInfo(
                annotation=type_, default=default, alias=alias
            )
        else:
            field_info = field_info or FieldInfo()
        kwargs = {"name": name, "field_info": field_info}
        if PYDANTIC_V2:
            kwargs.update({"mode": mode})
        else:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.8K bytes
    - Viewed (0)
Back to top