Skip to main content

SimpleBlockNode

This class represents a template node that handles block-level content by managing a list of child nodes. It extends the base node functionality to resolve arguments while automatically injecting the rendered content of its node list into the argument list. This allows for the seamless processing of nested template blocks within a custom tag's execution context.

Attributes

AttributeTypeDescription
nodelistdjango.template.NodeListA collection of template nodes representing the block's content that is rendered and inserted into the resolved arguments.

Constructor

Signature

def SimpleBlockNode(
nodelist: list,
*args: tuple,
**kwargs: dict
) - > null

Parameters

NameTypeDescription
nodelistlistThe list of nodes to be associated with this block.
*argstupleVariable length argument list.
**kwargsdictArbitrary keyword arguments.

Signature

def SimpleBlockNode(
nodelist: [NodeList](../base/nodelist.md?sid=django_template_base_nodelist),
*args: tuple,
**kwargs: dict
) - > null

Parameters

NameTypeDescription
nodelist[NodeList](../base/nodelist.md?sid=django_template_base_nodelist)A collection of template nodes to be rendered as the block's content
*argstupleVariable positional arguments passed to the parent SimpleNode constructor
**kwargsdictVariable keyword arguments passed to the parent SimpleNode constructor

Methods


get_resolved_arguments()

@classmethod
def get_resolved_arguments(
context: [Context](../context/context.md?sid=django_template_context_context)
) - > tuple

Resolves the tag's arguments from the context and inserts the rendered content of the block's nodelist into the argument list.

Parameters

NameTypeDescription
context[Context](../context/context.md?sid=django_template_context_context)The template context used to resolve variables and render the internal nodelist

Returns

TypeDescription
tupleA tuple containing the list of resolved positional arguments and a dictionary of resolved keyword arguments, with the rendered block content included