Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 252 for model1 (0.26 sec)

  1. tests/test_duplicate_models_openapi.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Model(BaseModel):
        pass
    
    
    class Model2(BaseModel):
        a: Model
    
    
    class Model3(BaseModel):
        c: Model
        d: Model2
    
    
    @app.get("/", response_model=Model3)
    def f():
        return {"c": {}, "d": {"a": {}}}
    
    
    client = TestClient(app)
    
    
    def test_get_api_route():
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  2. tests/test_filter_pydantic_sub_model/test_filter_pydantic_sub_model_pv1.py

        return client
    
    
    @needs_pydanticv1
    def test_filter_sub_model(client: TestClient):
        response = client.get("/model/modelA")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "name": "modelA",
            "description": "model-a-desc",
            "model_b": {"username": "test-user"},
        }
    
    
    @needs_pydanticv1
    def test_validator_is_cloned(client: TestClient):
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  3. tests/test_filter_pydantic_sub_model_pv2.py

                return name
    
        async def get_model_c() -> ModelC:
            return ModelC(username="test-user", password="test-password")
    
        @app.get("/model/{name}", response_model=ModelA)
        async def get_model_a(name: str, model_c=Depends(get_model_c)):
            return {"name": name, "description": "model-a-desc", "foo": model_c}
    
        client = TestClient(app)
        return client
    
    
    @needs_pydanticv2
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  4. docs/de/docs/tutorial/extra-models.md

    # Extramodelle
    
    Fahren wir beim letzten Beispiel fort. Es gibt normalerweise mehrere zusammengehörende Modelle.
    
    Insbesondere Benutzermodelle, denn:
    
    * Das **hereinkommende Modell** sollte ein Passwort haben können.
    * Das **herausgehende Modell** sollte kein Passwort haben.
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 30 20:26:47 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  5. platforms/core-configuration/configuration-cache/src/integTest/groovy/org/gradle/internal/cc/impl/isolated/IsolatedProjectsToolingApiCompositeBuildsIntegrationTest.groovy

                modelsCreated(":", ":a")
            }
    
            when:
            executer.withArguments(ENABLE_CLI)
            def model2 = runBuildAction(new FetchCustomModelForEachProjectInTree())
    
            then:
            model2.size() == 2
            model2[0].message == "It works from project :"
            model2[1].message == "It works from project :a"
    
            and:
            fixture.assertStateLoaded()
    
            when:
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Sat Jun 08 11:29:25 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  6. docs/pt/docs/tutorial/body-nested-models.md

    ## Modelos aninhados
    
    Cada atributo de um modelo Pydantic tem um tipo.
    
    Mas esse tipo pode ser outro modelo Pydantic.
    
    Portanto, você pode declarar "objects" JSON profundamente aninhados com nomes, tipos e validações de atributos específicos.
    
    Tudo isso, aninhado arbitrariamente.
    
    ### Defina um sub-modelo
    
    Por exemplo, nós podemos definir um modelo `Image`:
    
    ```Python hl_lines="9-11"
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  7. docs/de/docs/reference/openapi/models.md

    # OpenAPI-`models`
    
    OpenAPI Pydantic-Modelle, werden zum Generieren und Validieren der generierten OpenAPI verwendet.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 30 18:15:17 UTC 2024
    - 146 bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/extra-models.md

    # Extra Models
    
    Continuing with the previous example, it will be common to have more than one related model.
    
    This is especially the case for user models, because:
    
    * The **input model** needs to be able to have a password.
    * The **output model** should not have a password.
    * The **database model** would probably need to have a hashed password.
    
    !!! danger
        Never store user's plaintext passwords. Always store a "secure hash" that you can then verify.
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/body-nested-models.md

    ## Nested Models
    
    Each attribute of a Pydantic model has a type.
    
    But that type can itself be another Pydantic model.
    
    So, you can declare deeply nested JSON "objects" with specific attribute names, types and validations.
    
    All that, arbitrarily nested.
    
    ### Define a submodel
    
    For example, we can define an `Image` model:
    
    === "Python 3.10+"
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Mar 22 01:42:11 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  10. platforms/core-configuration/configuration-cache/src/integTest/groovy/org/gradle/internal/cc/impl/isolated/IsolatedProjectsToolingApiStreamingBuildActionIntegrationTest.groovy

            and:
            (model.left as GradleProject).name == "hello-world"
            (model.right as EclipseProject).gradleProject.name == "hello-world"
    
            and:
            def streamedModels = listener1.models as List<CustomModel>
            streamedModels.size() == 2
            streamedModels[0].value == 1
            streamedModels[1].value == 2
    
    
            when:
            withIsolatedProjects()
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Sat Jun 08 11:29:25 UTC 2024
    - 4.1K bytes
    - Viewed (0)
Back to top