Besides turning
restricted mode on or off,
customization control of the evaluation context is
available by means of:
domain.set_on_globals(name: str, value: any) -> None domain.set_namespace_on_globals(name: either(str, None), obj: any, no_underscored:bool=True) -> None mylocals = dict() # prepared as necessary template.evoque(mylocals)
The domain methods allow adding of objects
onto the domain-wide globals dict.
no_underscored: bool = True
By default, the set_namespace_on_globals()
methods look for an __all__
attribute on
the source object, and if one is found will only set
the what is listed by it.
If no one is found, it will import all attributes
but by default not those starting with an underscore —
behaviour that may be changed by setting
no_underscored = False
.
In addution, passing a prepared mylocals
dict to
template.evoque()
can additionally expose
specific objects per template evoque’ation.