pre-loading certain certain templates when the application starts (like a site-wide template) necessary to do the cheetah "#extends" style inheritance. I
Hi Benj. Mako Hill Can you show in an example how to preload the site wide base classes I m unable to do this and hence seriously limiting the Cheetah Template functionality On Fri, Mar 2, 2007 at 7:15 PM, Benj. Mako Hill <[email protected]> wrote: > Greetings, > > Thanks for web.py everyone. I've only been playing with it for a few > days now so please forgive any ignorance on my part. I'm having a great > time and looking forward to working with it a bit in the next couple > months. > > I was noticing a problem with cheetah. Please, check out the attached > patch and let know what you think about the problem/solution. > > The code I've removed in the patch was preventing pre-loading certain > certain templates when the application starts (like a site-wide > template) necessary to do the cheetah "#extends" style inheritance. It > does this because it tries to call the header template in a context > where there is no request yet. Renaming the templates from "foo.html" > to "foo.tmpl" makes the problem go away -- even though nothing else has > changed. > > At the very least, we shouldn't be calling header in this way and at > this place. > > But I can't figure out why it's there at all. Files that end in "html" > might, or might not, be UTF-8 encoded and I can't see any problems at > all that result from this just being turned off. > > Let me know if I've missed something. > > Regards, > Mako > > > -- > Benjamin Mako Hill > [email protected] > http://mako.cc/ > > Creativity can be a social contribution, but only in so > far as society is free to use the results. --RMS > > > > > --- /var/lib/python-support/python2.4/web/cheetah.py 2007-02-27 > 22:22:25.000000000 -0500 > +++ cheetah.py 2007-02-27 22:47:02.311913250 -0500 > @@ -80,9 +80,6 @@ > if not isinstance(terms, tuple): > terms = (terms,) > > - if not isString and template.endswith('.html'): > - header('Content-Type','text/html; charset=utf-8', unique=True) > - > if loadhooks.has_key('reloader'): > compiled_tmpl = __compiletemplate(template, base=base, > isString=isString) > else: > > -- Bidegg worlds best auction site http://bidegg.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/webpy?hl=en -~----------~----~----~----~------~----~------~--~---
