wijjit.core.view_router.ViewConfig
- class wijjit.core.view_router.ViewConfig(name, template='', template_file='', data=None, on_enter=None, on_exit=None, is_default=False, view_func=None, initialized=False, is_async=False, hooks_from_decorator=<factory>)[source]
Configuration for a view.
Supports both synchronous and asynchronous view functions and lifecycle hooks.
- Parameters:
name (
str) – Unique name for this viewtemplate (
str) – Template string (inline template content)template_file (
str) – Template filename to load from template_dirdata (
Callable[...,dict[str,Any]]orNone) – Function that returns data dict for template renderingon_enter (
Callable[[],None] | Callable[[],Awaitable[None]]orNone) – Hook called when navigating to this view (sync or async)on_exit (
Callable[[],None] | Callable[[],Awaitable[None]]orNone) – Hook called when navigating away from this view (sync or async)is_default (
bool) – Whether this is the default view (shown on startup)view_func (
Callable | Callable[...,Awaitable]orNone) – The original view function (used for lazy initialization, sync or async)initialized (
bool) – Whether this view has been initializedis_async (bool)
- Variables:
name (
str) – Unique name for this viewtemplate (
str) – Template string (inline template content)template_file (
str) – Template filename to load from template_dirdata (
Callable[...,dict[str,Any]]orNone) – Function that returns data dict for template renderingon_enter (
Callable[[],None] | Callable[[],Awaitable[None]]orNone) – Hook called when navigating to this view (sync or async)on_exit (
Callable[[],None] | Callable[[],Awaitable[None]]orNone) – Hook called when navigating away from this view (sync or async)is_default (
bool) – Whether this is the default viewview_func (
Callable | Callable[...,Awaitable]orNone) – The original view function (for lazy initialization, sync or async)initialized (
bool) – Whether this view has been initialized
- __init__(name, template='', template_file='', data=None, on_enter=None, on_exit=None, is_default=False, view_func=None, initialized=False, is_async=False, hooks_from_decorator=<factory>)
- Parameters:
name (str)
template (str)
template_file (str)
on_enter (Callable[[], None] | Callable[[], Awaitable[None]] | None)
on_exit (Callable[[], None] | Callable[[], Awaitable[None]] | None)
is_default (bool)
view_func (Callable[[...], Any] | Callable[[...], Awaitable[Any]] | None)
initialized (bool)
is_async (bool)
- Return type:
None
Methods
__init__(name[, template, template_file, ...])Attributes