Skip to content

Commit

Permalink
Merge branch 'master' into yoruba-translation-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AfolabiOlaoluwa committed Aug 11, 2023
2 parents cdf5576 + 78f38c6 commit 2c8ee1f
Show file tree
Hide file tree
Showing 10 changed files with 1,361 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/en/data/sponsors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ gold:
- url: https://www.buildwithfern.com/?utm_source=tiangolo&utm_medium=website&utm_campaign=main-badge
title: Fern | SDKs and API docs
img: https://fastapi.tiangolo.com/img/sponsors/fern.svg
- url: https://www.porter.run
title: Deploy FastAPI on AWS with a few clicks
img: https://fastapi.tiangolo.com/img/sponsors/porter.png
silver:
- url: https://www.deta.sh/?ref=fastapi
title: The launchpad for all your (team's) ideas
Expand Down Expand Up @@ -37,3 +40,6 @@ bronze:
- url: https://www.flint.sh
title: IT expertise, consulting and development by passionate people
img: https://fastapi.tiangolo.com/img/sponsors/flint.png
- url: https://bit.ly/3JJ7y5C
title: Build cross-modal and multimodal applications on the cloud
img: https://fastapi.tiangolo.com/img/sponsors/jina2.svg
2 changes: 2 additions & 0 deletions docs/en/data/sponsors_badge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ logins:
- databento-bot
- nanram22
- Flint-company
- porter-dev
- fern-api
Binary file added docs/en/docs/img/sponsors/porter-banner.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/en/docs/img/sponsors/porter.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/en/docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Latest Changes

* 🌐 Add Ukrainian translation for `docs/uk/docs/tutorial/cookie-params.md`. PR [#10032](https://github.com/tiangolo/fastapi/pull/10032) by [@rostik1410](https://github.com/rostik1410).
* 🌐 Add Russian translation for `docs/ru/docs/deployment/docker.md`. PR [#9971](https://github.com/tiangolo/fastapi/pull/9971) by [@Xewus](https://github.com/Xewus).
* 🌐 Add Vietnamese translation for `docs/vi/docs/python-types.md`. PR [#10047](https://github.com/tiangolo/fastapi/pull/10047) by [@magiskboy](https://github.com/magiskboy).
* 🔧 Add sponsor Porter. PR [#10051](https://github.com/tiangolo/fastapi/pull/10051) by [@tiangolo](https://github.com/tiangolo).
* 🔧 Update sponsors, add Jina back as bronze sponsor. PR [#10050](https://github.com/tiangolo/fastapi/pull/10050) by [@tiangolo](https://github.com/tiangolo).
* ✏️ Fix typo in deprecation warnings in `fastapi/params.py`. PR [#9854](https://github.com/tiangolo/fastapi/pull/9854) by [@russbiggs](https://github.com/russbiggs).
* ✏️ Fix typo in release notes. PR [#9835](https://github.com/tiangolo/fastapi/pull/9835) by [@francisbergin](https://github.com/francisbergin).
* ✏️ Fix typos in comments on internal code in `fastapi/concurrency.py` and `fastapi/routing.py`. PR [#9590](https://github.com/tiangolo/fastapi/pull/9590) by [@ElliottLarsen](https://github.com/ElliottLarsen).
Expand Down
2 changes: 1 addition & 1 deletion docs/en/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ extra:
- link: /uk/
name: uk
- link: /vi/
name: vi
name: vi - Tiếng Việt
- link: /yo/
name: yo - Yorùbá
- link: /zh/
Expand Down
6 changes: 6 additions & 0 deletions docs/en/overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
<img class="sponsor-image" src="/img/sponsors/fern-banner.svg" />
</a>
</div>
<div class="item">
<a title="Deploy FastAPI on AWS with a few clicks" style="display: block; position: relative;" href="https://www.porter.run" target="_blank">
<span class="sponsor-badge">sponsor</span>
<img class="sponsor-image" src="/img/sponsors/porter-banner.png" />
</a>
</div>
</div>
</div>
{% endblock %}
Expand Down
700 changes: 700 additions & 0 deletions docs/ru/docs/deployment/docker.md

Large diffs are not rendered by default.

96 changes: 96 additions & 0 deletions docs/uk/docs/tutorial/cookie-params.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Параметри Cookie

Ви можете визначити параметри Cookie таким же чином, як визначаються параметри `Query` і `Path`.

## Імпорт `Cookie`

Спочатку імпортуйте `Cookie`:

=== "Python 3.10+"

```Python hl_lines="3"
{!> ../../../docs_src/cookie_params/tutorial001_an_py310.py!}
```

=== "Python 3.9+"

```Python hl_lines="3"
{!> ../../../docs_src/cookie_params/tutorial001_an_py39.py!}
```

=== "Python 3.6+"

```Python hl_lines="3"
{!> ../../../docs_src/cookie_params/tutorial001_an.py!}
```

=== "Python 3.10+ non-Annotated"

!!! tip
Бажано використовувати `Annotated` версію, якщо це можливо.

```Python hl_lines="1"
{!> ../../../docs_src/cookie_params/tutorial001_py310.py!}
```

=== "Python 3.6+ non-Annotated"

!!! tip
Бажано використовувати `Annotated` версію, якщо це можливо.

```Python hl_lines="3"
{!> ../../../docs_src/cookie_params/tutorial001.py!}
```

## Визначення параметрів `Cookie`

Потім визначте параметри cookie, використовуючи таку ж конструкцію як для `Path` і `Query`.

Перше значення це значення за замовчуванням, ви можете також передати всі додаткові параметри валідації чи анотації:

=== "Python 3.10+"

```Python hl_lines="9"
{!> ../../../docs_src/cookie_params/tutorial001_an_py310.py!}
```

=== "Python 3.9+"

```Python hl_lines="9"
{!> ../../../docs_src/cookie_params/tutorial001_an_py39.py!}
```

=== "Python 3.6+"

```Python hl_lines="10"
{!> ../../../docs_src/cookie_params/tutorial001_an.py!}
```

=== "Python 3.10+ non-Annotated"

!!! tip
Бажано використовувати `Annotated` версію, якщо це можливо.

```Python hl_lines="7"
{!> ../../../docs_src/cookie_params/tutorial001_py310.py!}
```

=== "Python 3.6+ non-Annotated"

!!! tip
Бажано використовувати `Annotated` версію, якщо це можливо.

```Python hl_lines="9"
{!> ../../../docs_src/cookie_params/tutorial001.py!}
```

!!! note "Технічні Деталі"
`Cookie` це "сестра" класів `Path` і `Query`. Вони наслідуються від одного батьківського класу `Param`.
Але пам'ятайте, що коли ви імпортуєте `Query`, `Path`, `Cookie` та інше з `fastapi`, це фактично функції, що повертають спеціальні класи.

!!! info
Для визначення cookies ви маєте використовувати `Cookie`, тому що в іншому випадку параметри будуть інтерпритовані, як параметри запиту.

## Підсумки

Визначайте cookies за допомогою `Cookie`, використовуючи той же спільний шаблон, що і `Query` та `Path`.

0 comments on commit 2c8ee1f

Please sign in to comment.