Classes
KidaTemplates
3
▼
Django template backend for Kida.
KidaTemplates
3
▼
Django template backend for Kida.
Methods
from_string
1
KidaTemplate
▼
Create a template from a string.
from_string
1
KidaTemplate
▼
def from_string(self, template_code: str) -> KidaTemplate
Parameters
| Name | Type | Description |
|---|---|---|
template_code |
— |
Returns
KidaTemplate
get_template
1
KidaTemplate
▼
Load a template by name.
get_template
1
KidaTemplate
▼
def get_template(self, template_name: str) -> KidaTemplate
Parameters
| Name | Type | Description |
|---|---|---|
template_name |
— |
Returns
KidaTemplate
Internal Methods 1 ▼
__init__
1
▼
__init__
1
▼
def __init__(self, params: dict[str, Any]) -> None
Parameters
| Name | Type | Description |
|---|---|---|
params |
— |
KidaTemplate
3
▼
Django-compatible template wrapper around a Kida Template.
KidaTemplate
3
▼
Django-compatible template wrapper around a Kida Template.
Methods
origin
0
Any
▼
Template origin for Django's debug toolbar.
property
origin
0
Any
▼
def origin(self) -> Any
Returns
Any
render
2
str
▼
Render the template with the given context.
render
2
str
▼
def render(self, context: dict[str, Any] | None = None, request: Any = None) -> str
Parameters
| Name | Type | Description |
|---|---|---|
context |
— |
Template context dict. Default:None
|
request |
— |
Django HttpRequest (added to context as 'request'). Default:None
|
Returns
str
Rendered HTML string.
Internal Methods 1 ▼
__init__
1
▼
__init__
1
▼
def __init__(self, template: Any) -> None
Parameters
| Name | Type | Description |
|---|---|---|
template |
— |