Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template cache container uses a creation callable with stale context #87

Closed
sqlalchemy-bot opened this issue Jun 23, 2008 · 2 comments
Closed
Labels
bug Something isn't working caching low priority

Comments

@sqlalchemy-bot
Copy link

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

this because the Container in cache _get_container() is held in a dictionary, and the cache callable rendered in the template accesses the current context. The change would have to involve the cache callable getting at the current context, or perhaps _get_container() updating the container with the current callable.

        t = Template("""
        ${foo()}
        <%def name="foo()" cached="True" cache_timeout="2">
            <%
                 print "context", context
            %>
            foo
        </%def>
        """)
        
        import time
        x1 = t.render()
        time.sleep(3)
        x2 = t.render()
@sqlalchemy-bot
Copy link
Author

Michael Bayer (@zzzeek) wrote:

this got fixed as of release 0.2.3.

@sqlalchemy-bot
Copy link
Author

Changes by Michael Bayer (@zzzeek):

  • changed status to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working caching low priority
Projects
None yet
Development

No branches or pull requests

1 participant