Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for get_model (0.17 sec)

  1. tests/test_filter_pydantic_sub_model/app_pv1.py

            if not name.endswith("A"):
                raise ValueError("name must end in A")
            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)):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 784 bytes
    - Viewed (0)
  2. tests/test_compat.py

            model_config=BaseConfig,
        )
        assert not is_pv1_scalar_field(field)
    
    
    @needs_pydanticv2
    def test_get_model_config():
        # For coverage in Pydantic v2
        class Foo(BaseModel):
            model_config = ConfigDict(from_attributes=True)
    
        foo = Foo()
        config = _get_model_config(foo)
        assert config == {"from_attributes": True}
    
    
    def test_complex():
        app = FastAPI()
    
        @app.post("/")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  3. tests/test_filter_pydantic_sub_model_pv2.py

                    raise ValueError("name must end in A")
                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)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.3K bytes
    - Viewed (0)
  4. tests/test_datetime_custom_encoder.py

        app = FastAPI()
        model = ModelWithDatetimeField(dt_field=datetime(2019, 1, 1, 8))
    
        @app.get("/model", response_model=ModelWithDatetimeField)
        def get_model():
            return model
    
        client = TestClient(app)
        with client:
            response = client.get("/model")
        assert response.json() == {"dt_field": "2019-01-01T08:00:00+00:00"}
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.6K bytes
    - Viewed (0)
  5. docs_src/path_params/tutorial005.py

    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":
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Aug 26 13:26:03 GMT 2022
    - 546 bytes
    - Viewed (0)
  6. tests/test_filter_pydantic_sub_model/test_filter_pydantic_sub_model_pv1.py

            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/model/{name}": {
                    "get": {
                        "summary": "Get Model A",
                        "operationId": "get_model_a_model__name__get",
                        "parameters": [
                            {
                                "required": True,
                                "schema": {"title": "Name", "type": "string"},
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.5K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_path_params/test_tutorial005.py

            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/models/{model_name}": {
                    "get": {
                        "summary": "Get Model",
                        "operationId": "get_model_models__model_name__get",
                        "parameters": [
                            {
                                "required": True,
                                "schema": {"$ref": "#/components/schemas/ModelName"},
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 5K bytes
    - Viewed (0)
  8. maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java

            }
    
            Properties thisProvides = this.getModel().getProvides();
            Properties otherProvides = other.getModel().getProvides();
    
            return Objects.equals(thisProvides, otherProvides);
        }
    
        @Override
        public int hashCode() {
            int hashCode = (type == null) ? 0 : type.hashCode();
    
            if (this.getModel().getProvides() != null) {
    Java
    - Registered: Sun May 05 03:35:11 GMT 2024
    - Last Modified: Fri Sep 22 09:07:17 GMT 2023
    - 4.7K bytes
    - Viewed (0)
  9. maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java

        }
    
        @Nonnull
        @Override
        public Packaging getPackaging() {
            return packaging;
        }
    
        @Nonnull
        @Override
        public Model getModel() {
            return project.getModel().getDelegate();
        }
    
        @Nonnull
        @Override
        public Path getPomPath() {
            return nonNull(project.getFile(), "pomPath").toPath();
        }
    
        @Override
    Java
    - Registered: Sun May 05 03:35:11 GMT 2024
    - Last Modified: Mon Mar 25 10:50:01 GMT 2024
    - 6.5K bytes
    - Viewed (0)
  10. maven-core/src/test/java/org/apache/maven/MavenLifecycleParticipantTest.java

                            .getCanonicalPath());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
    
                project.getModel().addDependency(dependency);
            }
    
            @Override
            public void afterSessionStart(MavenSession session) {
                session.getUserProperties().setProperty("injected", "bar");
            }
        }
    
    Java
    - Registered: Sun Apr 28 03:35:10 GMT 2024
    - Last Modified: Sat Apr 15 17:24:20 GMT 2023
    - 6K bytes
    - Viewed (0)
Back to top