lavkach3
1from fastapi import APIRouter, Depends2from fastapi import Request3from fastapi.responses import HTMLResponse4
5from app.front.template_spec import templates6from app.front.utills import BasePermit7from core.frontend.constructor import ClassView8
9company_router = APIRouter()10
11
12class CompanyPermit(BasePermit):13permits = ['company_list']14
15
16@company_router.get("", response_class=HTMLResponse, dependencies=[Depends(CompanyPermit)])17async def company(request: Request):18cls = ClassView(request, model='company')19template = f'widgets/list{"" if request.scope["htmx"].hx_request else "-full"}.html'20return templates.TemplateResponse(request, template, context={'cls': cls})21