Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 566 for name (0.14 sec)

  1. tests/test_serialize_response_model.py

        return [
            Item(aliased_name="foo"),
            Item(aliased_name="bar", price=1.0),
            Item(aliased_name="baz", price=2.0, owner_ids=[1, 2, 3]),
        ]
    
    
    @app.get("/items/validdict", response_model=Dict[str, Item])
    def get_validdict():
        return {
            "k1": Item(aliased_name="foo"),
            "k2": Item(aliased_name="bar", price=1.0),
            "k3": Item(aliased_name="baz", price=2.0, owner_ids=[1, 2, 3]),
        }
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 4.2K bytes
    - Viewed (0)
  2. tests/test_read_with_orm_mode.py

        client = TestClient(app)
    
        person_data = {"name": "Dive", "lastname": "Wilson"}
        response = client.post("/people/", json=person_data)
        data = response.json()
        assert response.status_code == 200, response.text
        assert data["name"] == person_data["name"]
        assert data["lastname"] == person_data["lastname"]
        assert data["full_name"] == person_data["name"] + " " + person_data["lastname"]
    
    
    @needs_pydanticv1
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  3. tests/test_validate_response_recursive/app_pv1.py

    @app.get("/items/recursive", response_model=RecursiveItem)
    def get_recursive():
        return {"name": "item", "sub_items": [{"name": "subitem", "sub_items": []}]}
    
    
    @app.get("/items/recursive-submodel", response_model=RecursiveItemViaSubmodel)
    def get_recursive_submodel():
        return {
            "name": "item",
            "sub_items1": [
                {
                    "name": "subitem",
                    "sub_items2": [
                        {
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  4. tests/test_validate_response_recursive/app_pv2.py

    @app.get("/items/recursive", response_model=RecursiveItem)
    def get_recursive():
        return {"name": "item", "sub_items": [{"name": "subitem", "sub_items": []}]}
    
    
    @app.get("/items/recursive-submodel", response_model=RecursiveItemViaSubmodel)
    def get_recursive_submodel():
        return {
            "name": "item",
            "sub_items1": [
                {
                    "name": "subitem",
                    "sub_items2": [
                        {
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  5. tests/test_filter_pydantic_sub_model/app_pv1.py

    
    class ModelC(ModelB):
        password: str
    
    
    class ModelA(BaseModel):
        name: str
        description: Optional[str] = None
        model_b: ModelB
    
        @validator("name")
        def lower_username(cls, name: str, values):
            if not name.endswith("A"):
                raise ValueError("name must end in A")
            return name
    
    
    async def get_model_c() -> ModelC:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 784 bytes
    - Viewed (0)
  6. tests/test_tutorial/test_dataclasses/test_tutorial003.py

        response = client.post(
            "/authors/foo/items/",
            json=[{"name": "Bar"}, {"name": "Baz", "description": "Drop the Baz"}],
        )
        assert response.status_code == 200
        assert response.json() == {
            "name": "foo",
            "items": [
                {"name": "Bar", "description": None},
                {"name": "Baz", "description": "Drop the Baz"},
            ],
        }
    
    
    def test_get_authors():
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 12.1K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_dependencies/test_tutorial004_an_py310.py

                        {"item_name": "Foo"},
                        {"item_name": "Bar"},
                        {"item_name": "Baz"},
                    ]
                },
            ),
            (
                "/items?q=foo",
                200,
                {
                    "items": [
                        {"item_name": "Foo"},
                        {"item_name": "Bar"},
                        {"item_name": "Baz"},
                    ],
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 5.6K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_dependencies/test_tutorial004_an.py

                    "items": [
                        {"item_name": "Foo"},
                        {"item_name": "Bar"},
                        {"item_name": "Baz"},
                    ]
                },
            ),
            (
                "/items?q=foo",
                200,
                {
                    "items": [
                        {"item_name": "Foo"},
                        {"item_name": "Bar"},
                        {"item_name": "Baz"},
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 5.4K bytes
    - Viewed (0)
  9. tests/test_filter_pydantic_sub_model_pv2.py

            def lower_username(cls, name: str, info: ValidationInfo):
                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 Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.3K bytes
    - Viewed (0)
  10. tests/test_filter_pydantic_sub_model/test_filter_pydantic_sub_model_pv1.py

            "paths": {
                "/model/{name}": {
                    "get": {
                        "summary": "Get Model A",
                        "operationId": "get_model_a_model__name__get",
                        "parameters": [
                            {
                                "required": True,
                                "schema": {"title": "Name", "type": "string"},
                                "name": "name",
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.5K bytes
    - Viewed (0)
Back to top