Readme: padding in "Note" section
This commit is contained in:
parent
db341384a0
commit
fe1f12c3b2
1 changed files with 5 additions and 3 deletions
|
@ -102,6 +102,7 @@ You can
|
|||
copying the contents of `pages.py`
|
||||
|
||||
> **Note**
|
||||
>
|
||||
> In the paths files, FastAPI's decorators
|
||||
are called with `@self.app.`, not just `@app.`
|
||||
|
||||
|
@ -154,12 +155,13 @@ and can be deleted or edited, except:
|
|||
are stored in `app/sql/crud.py`
|
||||
|
||||
> **Note**
|
||||
>
|
||||
> As the official FastAPI documentation recommends (the link is above),
|
||||
there are two schemas — `User` and `UserCreate` — for one `User` SQLAlchemy model.
|
||||
there are two schemas — `User` and `UserCreate` — for one `User` SQLAlchemy model.
|
||||
> The first one is needed for SELECT requests,
|
||||
and the second one is for INSERT requests (creating users).
|
||||
and the second one is for INSERT requests (creating users).
|
||||
> The first one contains all information about user,
|
||||
but the second one (`UserCreate`) ommits `id` field,
|
||||
but the second one (`UserCreate`) ommits `id` field,
|
||||
because we don't want to specify an ID when creating a new user,
|
||||
it will be generated automatically by the MariaDB server.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue