- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 349 for read_item (0.06 sec)
-
docs_src/bigger_applications/app/routers/items.py
responses={404: {"description": "Not found"}}, ) fake_items_db = {"plumbus": {"name": "Plumbus"}, "gun": {"name": "Portal Gun"}} @router.get("/") async def read_items(): return fake_items_db @router.get("/{item_id}") async def read_item(item_id: str): if item_id not in fake_items_db: raise HTTPException(status_code=404, detail="Item not found")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Nov 29 17:32:18 UTC 2020 - 1011 bytes - Viewed (0) -
docs_src/path_params/tutorial001.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Mar 26 19:09:53 UTC 2020 - 138 bytes - Viewed (0) -
docs_src/query_params/tutorial002_py310.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jan 07 14:11:31 UTC 2022 - 219 bytes - Viewed (0) -
docs_src/query_params/tutorial001.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Mar 26 19:09:53 UTC 2020 - 250 bytes - Viewed (0) -
docs_src/templates/templates/item.html
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Jan 11 22:25:37 UTC 2024 - 235 bytes - Viewed (0) -
docs_src/templates/tutorial001.py
app = FastAPI() 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}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Dec 26 20:12:34 UTC 2023 - 521 bytes - Viewed (0) -
docs_src/response_model/tutorial004_py39.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat May 14 11:59:59 UTC 2022 - 627 bytes - Viewed (0) -
docs_src/extra_models/tutorial003_py310.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 644 bytes - Viewed (0) -
docs/en/docs/advanced/templates.md
So, the section with: {% raw %} ```jinja <a href="{{ url_for('read_item', id=id) }}"> ``` {% endraw %} ...will generate a link to the same URL that would be handled by the *path operation function* `read_item(id=id)`. For example, with an ID of `42`, this would render: ```html <a href="/items/42"> ```
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3.3K bytes - Viewed (0) -
docs/zh/docs/advanced/templates.md
```html Item ID: 42 ``` ### 模板 `url_for` 参数 你还可以在模板内使用 `url_for()`,其参数与*路径操作函数*的参数相同. 所以,该部分: {% raw %} ```jinja <a href="{{ url_for('read_item', id=id) }}"> ``` {% endraw %} ...将生成一个与处理*路径操作函数* `read_item(id=id)`的URL相同的链接 例如。当ID为 `42`时, 会渲染成: ```html <a href="/items/42"> ``` ## 模板与静态文件
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 2.8K bytes - Viewed (0)