Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for downes (0.19 sec)

  1. tests/test_response_model_data_filter.py

        )
        pet = PetDB(name="Nibbler", owner=user)
        return pet
    
    
    @app.get("/pets/", response_model=List[PetOut])
    async def read_pets():
        user = UserDB(
            email="******@****.***",
            hashed_password="secrethashed",
        )
        pet1 = PetDB(name="Nibbler", owner=user)
        pet2 = PetDB(name="Zoidberg", owner=user)
        return [pet1, pet2]
    
    
    client = TestClient(app)
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  2. tests/test_jsonable_encoder.py

            "name": "Firulais",
            "owner": {"name": "Foo"},
        }
    
    
    def test_encode_class():
        person = Person(name="Foo")
        pet = Pet(owner=person, name="Firulais")
        assert jsonable_encoder(pet) == {"name": "Firulais", "owner": {"name": "Foo"}}
        assert jsonable_encoder(pet, include={"name"}) == {"name": "Firulais"}
        assert jsonable_encoder(pet, exclude={"owner"}) == {"name": "Firulais"}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  3. docs_src/sql_databases/sql_app_py39/models.py

        items = relationship("Item", back_populates="owner")
    
    
    class Item(Base):
        __tablename__ = "items"
    
        id = Column(Integer, primary_key=True)
        title = Column(String, index=True)
        description = Column(String, index=True)
        owner_id = Column(Integer, ForeignKey("users.id"))
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 09 14:35:33 GMT 2024
    - 710 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py39.py

                                {"title": "Description", "type": "string"},
                            ),
                            "id": {"title": "Id", "type": "integer"},
                            "owner_id": {"title": "Owner Id", "type": "integer"},
                        },
                    },
                    "User": {
                        "title": "User",
                        "required": ["email", "id", "is_active"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.5K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_sql_databases/test_sql_databases_py310.py

                                {"title": "Description", "type": "string"},
                            ),
                            "id": {"title": "Id", "type": "integer"},
                            "owner_id": {"title": "Owner Id", "type": "integer"},
                        },
                    },
                    "User": {
                        "title": "User",
                        "required": ["email", "id", "is_active"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.5K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_sql_databases/test_sql_databases_py39.py

                                {"title": "Description", "type": "string"},
                            ),
                            "id": {"title": "Id", "type": "integer"},
                            "owner_id": {"title": "Owner Id", "type": "integer"},
                        },
                    },
                    "User": {
                        "title": "User",
                        "required": ["email", "id", "is_active"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.5K bytes
    - Viewed (0)
  7. docs_src/sql_databases/sql_app/schemas.py

    from pydantic import BaseModel
    
    
    class ItemBase(BaseModel):
        title: str
        description: Union[str, None] = None
    
    
    class ItemCreate(ItemBase):
        pass
    
    
    class Item(ItemBase):
        id: int
        owner_id: int
    
        class Config:
            orm_mode = True
    
    
    class UserBase(BaseModel):
        email: str
    
    
    class UserCreate(UserBase):
        password: str
    
    
    class User(UserBase):
        id: int
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 502 bytes
    - Viewed (0)
  8. docs_src/dependencies/tutorial008c_an_py39.py

    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
            raise InternalError(
                f"The portal gun is too dangerous to be owned by {username}"
            )
        if item_id != "plumbus":
            raise HTTPException(
                status_code=404, detail="Item not found, there's only a plumbus here"
            )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 700 bytes
    - Viewed (0)
  9. docs_src/sql_databases_peewee/sql_app/crud.py

    
    def get_items(skip: int = 0, limit: int = 100):
        return list(models.Item.select().offset(skip).limit(limit))
    
    
    def create_user_item(item: schemas.ItemCreate, user_id: int):
        db_item = models.Item(**item.dict(), owner_id=user_id)
        db_item.save()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 843 bytes
    - Viewed (0)
  10. docs_src/security/tutorial004_py310.py

        return current_user
    
    
    @app.get("/users/me/items/")
    async def read_own_items(current_user: User = Depends(get_current_active_user)):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4K bytes
    - Viewed (0)
Back to top