Pyramid 1.4a1 introduced a new syntax for using mako defs that are in a
mako template:
- The Mako renderer now supports a def name in an asset spec. When the def
name is present in the asset spec, the system will render the template def
within the template and will return the result. An example asset spec is
``package:path/to/template#defname.mako``. This will render the def named
``defname`` inside the ``template.mako`` template instead of rendering the
entire template. The old way of returning a tuple in the form
``('defname', {})`` from the view is supported for backward compatibility,
It looks like the old syntax now has a bug. I have a view-callable which
has a couple lines that look like the following:
@view_config(renderer='index.mako')
def myview(request, context):
if request.is_xhr:
return ('mydef', {'myvar': value}.values())
return {'myvar': value}
For some reason once the code under request.is_xhr is run the view-callable
will only ever call the mako def named mydef. It will never again render
the full index.mako template.
I will try to make a self-contained example that can be run as-is to convey
the bug properly and investigate the code around rendering mako defs, but
any insights about this would be nice. It will be easy enough for me to use
a regex to find all the places I am calling mako defs using the old syntax.
Thanks,
Jason
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.