- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 16 for lenet (0.13 sec)
-
tests/test_tutorial/test_path_params/test_tutorial005.py
assert response.status_code == 200 assert response.json() == {"model_name": "alexnet", "message": "Deep Learning FTW!"} def test_get_enums_lenet(): response = client.get("/models/lenet") assert response.status_code == 200 assert response.json() == {"model_name": "lenet", "message": "LeCNN all the images"} def test_get_enums_resnet(): response = client.get("/models/resnet") assert response.status_code == 200
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Sep 28 04:14:40 GMT 2023 - 5K bytes - Viewed (0) -
docs/en/docs/tutorial/path-params.md
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/ru/docs/tutorial/path-params.md
```Python hl_lines="20" {!../../../docs_src/path_params/tutorial005.py!} ``` !!! tip "Подсказка" Значение `"lenet"` также можно получить с помощью `ModelName.lenet.value`. #### Возврат *элементов перечисления* Из *операции пути* можно вернуть *элементы перечисления*, даже вложенные в тело JSON (например в `dict`).
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 14.1K bytes - Viewed (0) -
docs/zh/docs/tutorial/path-params.md
使用 `model_name.value` 或 `your_enum_member.value` 获取实际的值(本例中为**字符串**): ```Python hl_lines="20" {!../../../docs_src/path_params/tutorial005.py!} ``` !!! tip "提示" 使用 `ModelName.lenet.value` 也能获取值 `"lenet"`。 #### 返回*枚举元素* 即使嵌套在 JSON 请求体里(例如, `dict`),也可以从*路径操作*返回*枚举元素*。 返回给客户端之前,要把枚举元素转换为对应的值(本例中为字符串): ```Python hl_lines="18 21 23" {!../../../docs_src/path_params/tutorial005.py!}
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon Apr 01 05:35:40 GMT 2024 - 7.6K bytes - Viewed (0) -
docs/fr/docs/tutorial/path-params.md
```Python hl_lines="20" {!../../../docs_src/path_params/tutorial005.py!} ``` !!! tip "Astuce" Vous pouvez aussi accéder la valeur `"lenet"` avec `ModelName.lenet.value`. #### Retourner des *membres d'énumération* Vous pouvez retourner des *membres d'énumération* dans vos *fonctions de chemin*, même imbriquée dans un JSON (e.g. un `dict`).
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 10K bytes - Viewed (0) -
docs_src/path_params/tutorial005.py
class ModelName(str, Enum): alexnet = "alexnet" resnet = "resnet" lenet = "lenet" app = FastAPI() @app.get("/models/{model_name}") async def get_model(model_name: ModelName): if model_name is ModelName.alexnet: return {"model_name": model_name, "message": "Deep Learning FTW!"} if model_name.value == "lenet": return {"model_name": model_name, "message": "LeCNN all the images"}
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Aug 26 13:26:03 GMT 2022 - 546 bytes - Viewed (0) -
docs/de/docs/tutorial/path-params.md
```Python hl_lines="20" {!../../../docs_src/path_params/tutorial005.py!} ``` !!! tip "Tipp" Sie können den Wert `"lenet"` außerdem mittels `ModelName.lenet.value` abrufen. #### *Enum-Member* zurückgeben Sie können *Enum-Member* in ihrer *Pfadoperation* zurückgeben, sogar verschachtelt in einem JSON-Body (z. B. als `dict`).
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 20:28:59 GMT 2024 - 10.3K bytes - Viewed (0) -
docs/tr/docs/tutorial/path-params.md
```Python hl_lines="20" {!../../../docs_src/path_params/tutorial005.py!} ``` !!! tip "İpucu" `"lenet"` değerine `ModelName.lenet.value` tanımı ile de ulaşabilirsiniz. #### *Enumeration Üyelerini* Döndürelim JSON gövdesine (örneğin bir `dict`) gömülü olsalar bile *yol operasyonundaki* *enum üyelerini* döndürebilirsiniz.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 10.8K bytes - Viewed (0) -
docs/es/docs/tutorial/path-params.md
```Python hl_lines="20" {!../../../docs_src/path_params/tutorial005.py!} ``` !!! tip "Consejo" También podrías obtener el valor `"lenet"` con `ModelName.lenet.value`. #### Devuelve *enumeration members* Puedes devolver *enum members* desde tu *operación de path* inclusive en un body de JSON anidado (por ejemplo, un `dict`).
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 9.4K bytes - Viewed (0) -
docs/pt/docs/tutorial/path-params.md
```Python hl_lines="20" {!../../../docs_src/path_params/tutorial005.py!} ``` !!! tip "Dica" Você também poderia acessar o valor `"lenet"` com `ModelName.lenet.value` #### Retorne *membros de enumeration* Você pode retornar *membros de enum* da sua *rota de operação*, em um corpo JSON aninhado (por exemplo um `dict`).
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 9.7K bytes - Viewed (0)