lavkach3
1from fastapi import APIRouter, Depends2from fastapi import Request3from fastapi.responses import HTMLResponse4
5from app.front.apps.inventory.views import OrderView6from app.front.template_spec import templates7
8order_router = APIRouter()9
10
11@order_router.get("", response_class=HTMLResponse)12async def order(request: Request, view: OrderView = Depends()):13"""Список складских ордеров"""14template = f'widgets/list{"" if request.scope["htmx"].hx_request else "-full"}.html'15return templates.TemplateResponse(request, template, context={'cls': view})16
17
18@order_router.get("/mystore", response_class=HTMLResponse)19async def mystore(request: Request):20"""Интерфейс работы со своим складом"""21template = f'widgets/list{"" if request.scope["htmx"].hx_request else "-full"}.html'22order_cls = await OrderView(request)23store_dash = order_cls.get_store_dashboard()24return templates.TemplateResponse(request, template, context={'cls': cls})25