Method
__init__
(
self,
template: Any,
context: dict[str, Any],
status_code: int = 200,
headers: Mapping[str, str] | None = None,
media_type: str | None = None,
background: BackgroundTask | None = None,
)
Source from the content-addressed store, hash-verified
| 30 | |
| 31 | class _TemplateResponse(HTMLResponse): |
| 32 | def __init__( |
| 33 | self, |
| 34 | template: Any, |
| 35 | context: dict[str, Any], |
| 36 | status_code: int = 200, |
| 37 | headers: Mapping[str, str] | None = None, |
| 38 | media_type: str | None = None, |
| 39 | background: BackgroundTask | None = None, |
| 40 | ): |
| 41 | self.template = template |
| 42 | self.context = context |
| 43 | content = template.render(context) |
| 44 | super().__init__(content, status_code, headers, media_type, background) |
| 45 | |
| 46 | async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: |
| 47 | request = self.context.get("request", {}) |
Callers
nothing calls this directly
Tested by
no test coverage detected