Classes
If
4
▼
Conditional: {% if cond %}...{% elif cond %}...{% else %}...{% end %}
If
4
▼
Conditional: {% if cond %}...{% elif cond %}...{% else %}...{% end %}
Attributes
| Name | Type | Description |
|---|---|---|
test |
Expr
|
— |
body |
Sequence[Node]
|
— |
elif_ |
Sequence[tuple[Expr, Sequence[Node]]]
|
— |
else_ |
Sequence[Node]
|
— |
For
6
▼
For loop: {% for x in items %}...{% empty %}...{% end %}
For
6
▼
For loop: {% for x in items %}...{% empty %}...{% end %}
Attributes
| Name | Type | Description |
|---|---|---|
target |
Expr
|
— |
iter |
Expr
|
— |
body |
Sequence[Node]
|
— |
empty |
Sequence[Node]
|
— |
recursive |
bool
|
— |
test |
Expr | None
|
— |
AsyncFor
5
▼
Async for loop: {% async for x in async_items %}...{% end %}
AsyncFor
5
▼
Async for loop: {% async for x in async_items %}...{% end %}
Attributes
| Name | Type | Description |
|---|---|---|
target |
Expr
|
— |
iter |
Expr
|
— |
body |
Sequence[Node]
|
— |
empty |
Sequence[Node]
|
— |
test |
Expr | None
|
— |
While
2
▼
While loop: {% while cond %}...{% end %}
While
2
▼
While loop: {% while cond %}...{% end %}
Attributes
| Name | Type | Description |
|---|---|---|
test |
Expr
|
— |
body |
Sequence[Node]
|
— |
Match
2
▼
Pattern matching: {% match expr %}{% case pattern [if guard] %}...{% end %}
Match
2
▼
Pattern matching: {% match expr %}{% case pattern [if guard] %}...{% end %}
Attributes
| Name | Type | Description |
|---|---|---|
subject |
Expr | None
|
— |
cases |
Sequence[tuple[Expr, Expr | None, Sequence[Node]]]
|
— |
Break
0
▼
Break out of loop: {% break %}
Break
0
▼
Break out of loop: {% break %}
Continue
0
▼
Skip to next iteration: {% continue %}
Continue
0
▼
Skip to next iteration: {% continue %}
Try
3
▼
Error boundary: {% try %}...{% fallback [error] %}...{% end %}
Catches rendering errors in body an…
Try
3
▼
Error boundary: {% try %}...{% fallback [error] %}...{% end %}
Catches rendering errors in body and renders fallback content instead. If error_name is set, the caught exception is bound as a dict in the fallback scope with keys: message, type, template, line.
Attributes
| Name | Type | Description |
|---|---|---|
body |
Sequence[Node]
|
— |
fallback |
Sequence[Node]
|
— |
error_name |
str | None
|
— |