Skip to content

inconsistent behavior of filter pulling from context based on name #140

@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Michael Bayer (@zzzeek)

this is related to #3 but seems different

from mako.template import Template

x = Template("""
X:
    ${"asdf" | h.foo}
""")

y = Template("""
Y:
    ${"asdf" | z.foo}
""")

z = Template("""
Z:
    ${h}
    ${"asdf" | h.foo}
""")

class h(object):
    foo = str

try:
    print x.render(h=h)
except NameError, e:
    print e

print y.render(z=h)
print z.render(h=h)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions