On 02/21/2017 01:43 AM, Jinghui Niu wrote:
> I've learned that the returned value for context.namespaces.values() is
> a dictionary-like object, which doesn't remember to which layer of the
> inheritance chain itself is attached. Is there a way to group all those
> TemplateNamespaces into different layers of inheritance?
> Here is an example:
> basepage.mako ( namespace_attachedTo_basepage001.mako,
> namespace_attachedTo_basepage002.mako )
> childpage.mako ( namespace_attachedTo_childpage.mako )
> I would like to group the first two TemplateNamespaces into one layer,
> and the third TemplateNamespace into the second layer.
> Is there a way to do this in Mako? Thanks.
It likely pulls all the namespaces in without recording this information
so this would not be possible.
But also, Mako's template structure is not organized for deep
introspection. This is not really something one should need if using
the template system normally. I doubt Mako is well organized for
"meta" templating as it seems you're trying to do here.
> You received this message because you are subscribed to the Google
> Groups "Mako Templates for Python" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to mako-discuss...@googlegroups.com