- Sort Score
- Result 10 results
- Languages All
Results 1 - 8 of 8 for if (0.13 sec)
-
docs_src/path_params_numeric_validations/tutorial002.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 265 bytes - Viewed (0) -
docs_src/dependencies/tutorial002.py
self.q = q self.skip = skip self.limit = limit @app.get("/items/") async def read_items(commons: CommonQueryParams = Depends(CommonQueryParams)): response = {} if commons.q: response.update({"q": commons.q}) items = fake_items_db[commons.skip : commons.skip + commons.limit] response.update({"items": items})
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 656 bytes - Viewed (0) -
docs_src/body/tutorial002.py
description: Union[str, None] = None price: float tax: Union[float, None] = None app = FastAPI() @app.post("/items/") async def create_item(item: Item): item_dict = item.dict() if item.tax: price_with_tax = item.price + item.tax item_dict.update({"price_with_tax": price_with_tax})
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 467 bytes - Viewed (0) -
docs_src/query_params/tutorial002.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 251 bytes - Viewed (0) -
docs_src/query_params_str_validations/tutorial002.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 308 bytes - Viewed (0) -
docs_src/additional_responses/tutorial002.py
200: { "content": {"image/png": {}}, "description": "Return the JSON item or an image.", } }, ) async def read_item(item_id: str, img: Union[bool, None] = None): if img: return FileResponse("image.png", media_type="image/png") else:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 628 bytes - Viewed (0) -
docs_src/background_tasks/tutorial002.py
app = FastAPI() def write_log(message: str): with open("log.txt", mode="a") as log: log.write(message) def get_query(background_tasks: BackgroundTasks, q: Union[str, None] = None): if q: message = f"found query: {q}\n" background_tasks.add_task(write_log, message) return q @app.post("/send-notification/{email}") async def send_notification(
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 675 bytes - Viewed (0) -
docs_src/websockets/tutorial002.py
async def get(): return HTMLResponse(html) async def get_cookie_or_token( websocket: WebSocket, session: Union[str, None] = Cookie(default=None), token: Union[str, None] = Query(default=None), ): if session is None and token is None: raise WebSocketException(code=status.WS_1008_POLICY_VIOLATION) return session or token @app.websocket("/items/{item_id}/ws") async def websocket_endpoint(
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sun Nov 13 16:10:54 GMT 2022 - 2.8K bytes - Viewed (0)