[Grok-dev] Re: RFC: Making the automatic registration of templates more explicit

Philipp von Weitershausen philipp at weitershausen.de
Sat Feb 3 15:25:38 EST 2007


Martijn Faassen wrote:
> ct at gocept.com wrote:
>> Sorry for catching up so late. I'm trying to remember everything that
>> popped up in my mind while reading this thread.
>>
>> 1. I like grok.template('asdf') on a module level in opposition to
>> "consume all templates".
> 
> Actually we should consider symmetry here, and since we already have:
> 
> foo = grok.PageTemplate('somethingorother')
> 
> we could also introduce:
> 
> bar = grok.PageTemplateFile('somefile') # without extension

Why without extension? As said, we already have grok.PageTemplateFile, 
you use it this way:

food = grok.PageTemplateFile(os.path.join('templatedirectoryname',
                                           'food.pt'))

Of course, that sucks, so perhaps we should change it to take the 
setting of grok.templatedir() into account or the default setting if 
that's not present (<module>_templates).

> this would be a lot more symmetrical than a new toplevel directive.

Agreed.


-- 
http://worldcookery.com -- Professional Zope documentation and training
Next Zope 3 training at Camp5: http://trizpug.org/boot-camp/camp5


More information about the Grok-dev mailing list