tm128 <developm...@e-ventis.eu> added the comment:

Am 21.07.2010 15:34, schrieb Malthe Borch:
> Malthe Borch<mbo...@gmail.com>  added the comment:
>
> I'm not sure what this is, but it's not the first report I get about it.
>    

Thank you for your quick reply. I played around a few hours.
I ran the same application under zope and it works without problems.
> It's difficult to debug without some way of reproducing it consistently,
although it
> seems to revolve around thread-safety.
>
> One thing about it though is that you seem to be compiling at run-time,
> repeatedly. That's not a good idea. Either use a template loader object, or 
> define
> your template object on module- or class level.
>    

My tal-snippets is stored in sql-database and is compiled at runtime. It is a
feature not a bug.

I had a look at source of template-loader and it looks like it works only with
files in filesystem.

I tried also do define a template on module level. It has now effekt, same 
error.

But i found a temporary solution, "patching" zpt.PageTemplate

"""

from chameleon.zpt.template import PageTemplate as BaseClass
from chameleon.core import filecache

class PageTemplate(BaseClass):

    def __init__(self, body, *args, **kwargs):
        body = '<html tal:omit-tag="">'+body+'</html>'
        super(PageTemplate, self).__init__(body, *args, **kwargs)
        self.registry = filecache.TemplateCache( '/tmp/mytempcache', 0)

"""

Is there a solution for dynamic template-strings? It seems to work, but i am not
sure what happens, if template changes.

__________________________________
Repoze Bugs <b...@bugs.repoze.org>
<http://bugs.repoze.org/issue156>
__________________________________
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to