lavkach3
1from fastapi import APIRouter, Depends2from fastapi import Request3from fastapi.responses import HTMLResponse4
5from app.front.apps.inventory.views import MoveView6from app.front.template_spec import templates7
8move_router = APIRouter()9
10@move_router.get("", response_class=HTMLResponse)11async def move(cls: MoveView = Depends()):12"""Список перемещений"""13template = f'widgets/list{"" if cls.r.scope["htmx"].hx_request else "-full"}.html'14return templates.TemplateResponse(cls.r, template, context={'cls': cls})15
16
17
18@move_router.get("/kanban", response_class=HTMLResponse)19async def move(request: Request):20"""21kanban custom view
22"""
23cls = MoveView(request)24view = await cls._get_table()25template = f'inventory/move/move_list{"" if request.scope["htmx"].hx_request else "-full"}.html'26return templates.TemplateResponse(request, template, context={'view': view})27