dj_angles.templatetags.call¶
Module Contents¶
- dj_angles.templatetags.call.logger¶
- dj_angles.templatetags.call.get_tag_args(token, tag_name: str, min_args: int = 1) → tuple[dj_angles.evaluator.ParsedFunction, list[str], str | None]¶
Parses the token to get the arguments for a tag.
- Parameters:
token – The token to parse.
tag_name – The name of the tag.
min_args – The minimum number of arguments required.
- Returns:
- The parsed function, the remaining arguments,
and the context variable name.
- Return type:
tuple[ParsedFunction, list[str], str | None]
- dj_angles.templatetags.call.resolve(context, arg)¶
Resolves a template variable based on the context if it’s a TemplateVariable. Otherwise, evaluate the arg.
- Parameters:
context (param) – The template context.
arg (param) – The variable to resolve.
- Returns:
The resolved value of the variable.
- class dj_angles.templatetags.call.CallNode(parsed_function, context_variable_name)¶
Bases:
django.template.Node- parsed_function¶
- context_variable_name¶
- resolve_args(context, portion)¶
- resolve_kwargs(context, portion)¶
- get_result(context, obj, portion)¶
- render(context)¶
Execute the function with the provided arguments and stores the results in context.