🌐 Add Japanese translation for docs/ja/docs/tutorial/extra-models.md#1941
Conversation
…/ryuckel/fastapi into feature/add-japanese-translation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #1941 +/- ##
===========================================
Coverage 100.00% 100.00%
===========================================
Files 540 239 -301
Lines 13969 7079 -6890
===========================================
- Hits 13969 7079 -6890 ☔ View full report in Codecov by Sentry. |
|
📝 Docs preview for commit 01c233f at: https://5f3fe3fb73d0e97772ee935f--fastapi.netlify.app |
|
📝 Docs preview for commit fac0a58 at: https://5f424ef9a293b75f104a998a--fastapi.netlify.app |
|
📝 Docs preview for commit cec7a6c at: https://5f4cbf5cb850660e0943d2cb--fastapi.netlify.app |
| @@ -0,0 +1,195 @@ | |||
| # 追加モデル | |||
There was a problem hiding this comment.
モデル - より詳しく
(extraはいい訳がないので、がっつり意訳しないと不自然な気がします。目次を見ると、Response Modelsの次がこのセクションで、Response Modelsで紹介しなかったことをより詳しく紹介している章なのでこの様な見出しはどうでしょうか)
| これはユーザーモデルの場合は特にそうです。なぜなら: | ||
|
|
||
| * **入力モデル** にはパスワードが必要です。 | ||
| * **出力モデル**にはパスワードを設定すべきではありません。 |
| * **データベースモデル**はおそらくハッシュ化されたパスワードが必要になるでしょう。 | ||
|
|
||
| !!! danger "危険" | ||
| ユーザーの平文のパスワードは絶対に保存しないでください。常に「安全なハッシュ」を保存し、それを確認することができます。 |
There was a problem hiding this comment.
ユーザーの平文のパスワードは絶対に保存しないでください。常に認証に利用可能な「安全なハッシュ」を保存してください。
|
|
||
| ## 複数のモデル | ||
|
|
||
| ここでは、モデルのパスワードフィールドと使用場所でモデルがどのように見えるのか、大まかなイメージを紹介します: |
There was a problem hiding this comment.
ここでは、パスワードフィールドをもつモデルがどのように見えるのか、また、どこで使われるのか、大まかなイメージを紹介します:
| user_dict = user_in.dict() | ||
| ``` | ||
|
|
||
| これで変数`user_dict`のデータを持つ`dict`ができました。(これはPydanticモデルのオブジェクトの代わりに`dict`です)。 |
There was a problem hiding this comment.
これで変数user_dictのデータを持つdictができました。(これはPydanticモデルのオブジェクトの代わりになるdictです)。
| ```Python | ||
| UserInDB( | ||
| username = user_dict["username"], | ||
| password = user_dict["password"],これやばい |
There was a problem hiding this comment.
password = user_dict["password"],
There was a problem hiding this comment.
変な日本語入ってましたね...;;
修正しました!
| ) | ||
| ``` | ||
|
|
||
| #### 別の内容からのPydanticモデル |
|
|
||
| ## `Union`または`anyOf` | ||
|
|
||
| レスポンスを2つの型の`Union`と宣言することができます。 |
There was a problem hiding this comment.
レスポンスを2つの型のUnionとして宣言することができます。
|
|
||
| 複数のPydanticモデルを使用し、ケースごとに自由に継承します。 | ||
|
|
||
| エンティティが異なる「状態」を持つことができる必要がある場合は、ケンティティごとに単一のデータモデルを持つ必要はありません。ユーザー「エンティティ」の場合と同様に、`password`や`password_hash`を含み、パスワードはありません。 |
There was a problem hiding this comment.
エンティティが異なる「状態」を持てなければならない場合は、エンティティごとに単一のデータモデルを持つ必要はありません。passwordやpassword_hashやパスワードなしなどのいくつかの「状態」をもつユーザー「エンティティ」の場合の様にすれば良いのです。
|
📝 Docs preview for commit 1164fea at: https://5f9aa712efcb983ab7c43051--fastapi.netlify.app |
|
@tokusumi |
|
📝 Docs preview for commit e7b32fa at: https://5f9aa94d5f755e2598dad129--fastapi.netlify.app |
tokusumi
left a comment
There was a problem hiding this comment.
your awesome works are really helpful. Thank you🎉
docs/ja/docs/tutorial/extra-models.md
|
📝 Docs preview for commit 4b6e845 at: https://6499c2f1bac8cd0083555671--fastapi.netlify.app |
This PR translates the tutorial/extra-models.md to Japanese.
Please review tutorial/extra-models.md
Issue #1571 generates a new directory to support Japanese.PR #1656 generates a new directory for tutorial.
I will fix dependency after #1571 & #1656 are merged.