[Grok-dev] Grok 1.0 final?

Martijn Faassen faassen at startifact.com
Wed Apr 15 07:08:00 EDT 2009

Martin Aspeli wrote:
> Wichert Akkerman wrote:
>> templates/<context id>_<view id>
> +1
>> .html
> -1
>> where context id probably defaults to the __name__ of the view context,
>> and view id to the name of the view.
> +1
>> I prefer to use html as extension
>> for attribute based template languages (genshi, tal, kid, etc.) so tools
>> such as html editors and browsers know how to handle the file.
> -1 -- The filename should indicate how the file will be treated. .html 
> means "this is a static html file", whereas ".pt" says "this is TAL".

I'd like to explore this further, as I think many people would like this 
design (as +1 and -1-ed by Martin). I'd like to see a grok extension 
(probably a different grok view base class) that supports this pattern. 
We can then consider this for adoption in the core at some point.

Issues to explore are naming views that have an interface as context, 
and I'm sure a lot more.

Note that Grok's template language pluggability also relies on 
extensions. If you want to use a different templating language for a 
view, you just use a different extension. If you were to use .html for 
everything you'd probably need to indicate in the view what template 
language you're using, or indicate it globally. I'd not mind if the 
extension had optional support for this, but the main use case should be 
one extension per template language in my opinion.



More information about the Grok-dev mailing list