- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 21 for inherits (0.16 sec)
-
docs/en/docs/tutorial/security/first-steps.md
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Wed Mar 13 19:02:19 GMT 2024 - 8.9K bytes - Viewed (0) -
docs/en/docs/tutorial/path-params.md
### Create an `Enum` class Import `Enum` and create a sub-class that inherits from `str` and from `Enum`. By inheriting from `str` the API docs will be able to know that the values must be of type `string` and will be able to render correctly.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 9.1K bytes - Viewed (0) -
docs/en/docs/tutorial/first-steps.md
```Python hl_lines="1" {!../../../docs_src/first_steps/tutorial001.py!} ``` `FastAPI` is a Python class that provides all the functionality for your API. !!! note "Technical Details" `FastAPI` is a class that inherits directly from `Starlette`. You can use all the <a href="https://www.starlette.io/" class="external-link" target="_blank">Starlette</a> functionality with `FastAPI` too. ### Step 2: create a `FastAPI` "instance"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu May 02 22:37:31 GMT 2024 - 12K bytes - Viewed (0) -
docs/en/docs/tutorial/response-model.md
How does this work? Let's check that out. 🤓 ### Type Annotations and Tooling First let's see how editors, mypy and other tools would see this. `BaseUser` has the base fields. Then `UserIn` inherits from `BaseUser` and adds the `password` field, so, it will include all the fields from both models. We annotate the function return type as `BaseUser`, but we are actually returning a `UserIn` instance.
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) -
docs/en/docs/tutorial/request-files.md
!!! tip Prefer to use the `Annotated` version if possible. ```Python hl_lines="7" {!> ../../../docs_src/request_files/tutorial001.py!} ``` !!! info `File` is a class that inherits directly from `Form`. But remember that when you import `Query`, `Path`, `File` and others from `fastapi`, those are actually functions that return special classes. !!! tip
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Wed Mar 13 19:02:19 GMT 2024 - 10.2K bytes - Viewed (0) -
docs/en/docs/alternatives.md
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) -
docs/en/docs/tutorial/request-forms.md
With `Form` you can declare the same configurations as with `Body` (and `Query`, `Path`, `Cookie`), including validation, examples, an alias (e.g. `user-name` instead of `username`), etc. !!! info `Form` is a class that inherits directly from `Body`. !!! tip To declare form bodies, you need to use `Form` explicitly, because without it the parameters would be interpreted as query parameters or body (JSON) parameters. ## About "Form Fields"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Wed Mar 13 19:02:19 GMT 2024 - 3.2K bytes - Viewed (0) -
docs/en/docs/tutorial/body.md
``` === "Python 3.8+" ```Python hl_lines="4" {!> ../../../docs_src/body/tutorial001.py!} ``` ## Create your data model Then you declare your data model as a class that inherits from `BaseModel`. Use standard Python types for all the attributes: === "Python 3.10+" ```Python hl_lines="5-9" {!> ../../../docs_src/body/tutorial001_py310.py!} ``` === "Python 3.8+"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 7.3K bytes - Viewed (0) -
docs/en/docs/tutorial/handling-errors.md
"size": "XL" } } ``` #### FastAPI's `HTTPException` vs Starlette's `HTTPException` **FastAPI** has its own `HTTPException`. And **FastAPI**'s `HTTPException` error class inherits from Starlette's `HTTPException` error class. The only difference is that **FastAPI**'s `HTTPException` accepts any JSON-able data for the `detail` field, while Starlette's `HTTPException` only accepts strings for it.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 9.1K bytes - Viewed (0) -
docs/en/docs/advanced/dataclasses.md
Check the in-code annotation tips above to see more specific details. ## Learn More You can also combine `dataclasses` with other Pydantic models, inherit from them, include them in your own models, etc. To learn more, check the <a href="https://docs.pydantic.dev/latest/concepts/dataclasses/" class="external-link" target="_blank">Pydantic docs about dataclasses</a>. ## Version
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 4.1K bytes - Viewed (0)