wijjit.core.templating.RenderedView

class wijjit.core.templating.RenderedView(template='', template_file='', context=<factory>)[source]

Immutable result of a view function describing what to render.

A view function returns one of these (via render_template_string() or render_template()) instead of the legacy {"template": ..., "data": {...}} dict. Exactly one of template or template_file is set.

Parameters:
  • template (str, optional) – Inline template source. Mutually exclusive with template_file.

  • template_file (str, optional) – Template filename to load from the configured template directory. Mutually exclusive with template.

  • context (dict, optional) – Mapping of names made available to the template. state is injected automatically by the renderer if not present, so templates can always use {{ state.x }}.

Notes

Lifecycle hooks (on_enter / on_exit) are not carried here - they are declared on the @app.view(...) decorator, which keeps per-render output separate from view lifecycle configuration.

__init__(template='', template_file='', context=<factory>)
Parameters:
Return type:

None

Methods

__init__([template, template_file, context])

Attributes

template

template_file

context

template: str = ''
template_file: str = ''
context: dict[str, Any]