Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for ModelName (1.2 sec)

  1. docs_src/path_params/tutorial005_py39.py

    from enum import Enum
    
    from fastapi import FastAPI
    
    
    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":
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 546 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_path_params/test_tutorial005.py

                                "items": {"$ref": "#/components/schemas/ValidationError"},
                            }
                        },
                    },
                    "ModelName": {
                        "title": "ModelName",
                        "enum": ["alexnet", "resnet", "lenet"],
                        "type": "string",
                    },
                    "ValidationError": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  3. docs/de/docs/tutorial/path-params.md

    ///
    
    ### Einen *Pfad-Parameter* deklarieren { #declare-a-path-parameter }
    
    Dann erstellen Sie einen *Pfad-Parameter*, der als Typ die gerade erstellte Enum-Klasse hat (`ModelName`):
    
    {* ../../docs_src/path_params/tutorial005_py39.py hl[16] *}
    
    ### Die API-Dokumentation testen { #check-the-docs }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 10.5K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/path-params.md

    ///
    
    ### Declare a *path parameter* { #declare-a-path-parameter }
    
    Then create a *path parameter* with a type annotation using the enum class you created (`ModelName`):
    
    {* ../../docs_src/path_params/tutorial005_py39.py hl[16] *}
    
    ### Check the docs { #check-the-docs }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 9.2K bytes
    - Viewed (0)
  5. docs/es/docs/tutorial/path-params.md

    ///
    
    ### Declarar un *path parameter* { #declare-a-path-parameter }
    
    Luego crea un *path parameter* con una anotación de tipo usando la clase enum que creaste (`ModelName`):
    
    {* ../../docs_src/path_params/tutorial005_py39.py hl[16] *}
    
    ### Revisa la documentación { #check-the-docs }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 9.8K bytes
    - Viewed (0)
  6. docs/ru/docs/tutorial/path-params.md

    ///
    
    ### Определение *параметра пути* { #declare-a-path-parameter }
    
    Определите *параметр пути*, используя в аннотации типа класс перечисления (`ModelName`), созданный ранее:
    
    {* ../../docs_src/path_params/tutorial005_py39.py hl[16] *}
    
    ### Проверьте документацию { #check-the-docs }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 14.2K bytes
    - Viewed (0)
  7. docs/pt/docs/tutorial/path-params.md

    ///
    
    ### Declare um parâmetro de path { #declare-a-path-parameter }
    
    Em seguida, crie um *parâmetro de path* com anotação de tipo usando a classe enum que você criou (`ModelName`):
    
    {* ../../docs_src/path_params/tutorial005_py39.py hl[16] *}
    
    ### Verifique a documentação { #check-the-docs }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 9.8K bytes
    - Viewed (0)
Back to top