- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 35 for item (0.14 sec)
-
docs_src/body_fields/tutorial001.py
app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = Field( default=None, title="The description of the item", max_length=300 ) price: float = Field(gt=0, description="The price must be greater than zero") tax: Union[float, None] = None @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item = Body(embed=True)):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 561 bytes - Viewed (0) -
docs_src/body_nested_models/tutorial001.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 402 bytes - Viewed (0) -
docs_src/response_directly/tutorial001.py
from pydantic import BaseModel class Item(BaseModel): title: str timestamp: datetime description: Union[str, None] = None app = FastAPI() @app.put("/items/{id}") def update_item(id: str, item: Item): json_compatible_item_data = jsonable_encoder(item)
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 505 bytes - Viewed (0) -
docs_src/custom_response/tutorial001.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 197 bytes - Viewed (0) -
docs_src/body_multiple_params/tutorial001.py
from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None @app.put("/items/{item_id}") async def update_item( *, item_id: int = Path(title="The ID of the item to get", ge=0, le=1000), q: Union[str, None] = None, item: Union[Item, None] = None, ): results = {"item_id": item_id}
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 596 bytes - Viewed (0) -
docs_src/generate_clients/tutorial001.py
from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str price: float class ResponseMessage(BaseModel): message: str @app.post("/items/", response_model=ResponseMessage) async def create_item(item: Item): return {"message": "item received"} @app.get("/items/", response_model=List[Item]) async def get_items(): return [ {"name": "Plumbus", "price": 3},
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Mar 04 22:02:18 GMT 2022 - 519 bytes - Viewed (0) -
docs_src/events/tutorial001.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 283 bytes - Viewed (0) -
docs_src/templates/tutorial001.py
app.mount("/static", StaticFiles(directory="static"), name="static") templates = Jinja2Templates(directory="templates") @app.get("/items/{id}", response_class=HTMLResponse) async def read_item(request: Request, id: str): return templates.TemplateResponse( request=request, name="item.html", context={"id": id}
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Dec 26 20:12:34 GMT 2023 - 521 bytes - Viewed (0) -
docs_src/body_updates/tutorial001.py
} @app.get("/items/{item_id}", response_model=Item) async def read_item(item_id: str): return items[item_id] @app.put("/items/{item_id}", response_model=Item) async def update_item(item_id: str, item: Item): update_item_encoded = jsonable_encoder(item) items[item_id] = update_item_encoded
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 906 bytes - Viewed (0) -
docs_src/separate_openapi_schemas/tutorial001.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Aug 25 19:10:22 GMT 2023 - 489 bytes - Viewed (0)