[Grok-dev] Re: Skinning/themeing

Martin Aspeli optilude at gmx.net
Sun May 20 09:45:29 EDT 2007


kevin at mcweekly.com wrote:

> However, I feel like this is a bit of an overreaction. Putting  
> templates in the __doc__ won't kill kittens, or doom one to a life of  
> eternal perl programming. Even python noobs learn about __doc__.

Of course, I'd just argue that it's bad form. It's an unnecessary 
overloading of an already established concept. I don't think anyone 
should stop you from doing it, but I do think we should *not* do this in 
any examples or documentation we promote.

> With megrok.quarry.template, using dotted notation, any object that  
> can be imported can be template, including inline pagetemplates,  
> strings and unicode. So they can be put in the docstring.
> 
> For short templates, or short ajaxy stuff, I put the template right in  
> the docstring of view class using quarry.template('__doc__'), that way  
> everything I need to see is right there.

I don't see why it can't just be a class variable that you assign to.

class Foo(...):
  template = """ ... """

> IMO grok shouldn't be made so inflexible that it dictates how I might  
> style my code, where I must stick my templates... or even what editor  
> *cough*emacs*cough* should be. :)

Agree.

> And for ironic amusement: The 'provider' namespace is not available  
> and will raise an error in in-line pagetemplates - only  
> pagetemplatefiles. Not sure if this is a bug in Grok or upstream. :)

Should probably be fixed.

> Keep on grokking in the free world,

Excellent - we should put that slogan somewhere prominent. ;-)

Martin



More information about the Grok-dev mailing list