[albatross-users] ctx.locals.__page__ for random pages

Matt Goodall matt at pollenation.net
Thu Aug 14 22:13:56 EST 2003


Actually, it would be really nice if run_template() could cope with 
template file paths relative to the current page path. If the template 
name starts with a '/' then it's relative to the TemplateLoaderMixin's 
base_dir, otherwise it's relative to that base_dir plus the 
os.path.dirname() of the page module.

For a page module '/one/two/three/page.py' that would let you do:

    def page_display(ctx):
        ctx.runtemplate('page.html')

rather than

    def page_display(ctx):
        ctx.runtemplate('one/two/three/page.html')

I think this would only make sense for random apps though, where the 
page modules and template files live together.

By the way, is it deliberate that the template name cannot start with a 
'/' at the moment?

Cheers, Matt

-- 
Matt Goodall, Pollenation Internet Ltd
w: http://www.pollenationinternet.com
e: matt at pollenation.net





More information about the Albatross-users mailing list