[Grok-dev] cheetah templates

Paul Wilson paulalexwilson at gmail.com
Sun Feb 1 14:53:08 EST 2009


2009/2/1 Milos Negovanovic <milos.negovanovic at googlemail.com>:
> Hi,
>
> Fallowing this tutorial -> http://grok.zope.org/documentation/how-to/plugging-in-new-template-languages
> I have these 2 classes:
>
> class CheetahTemplate(grok.components.GrokTemplate):
>    def setFromString(self, string):
>        self._template = Template.compile(source=string)
>
>    def setFromFilename(self, filename, _prefix=None):
>        self._template = Template.compile(file=os.path.join(_prefix, filename))
>
>    def render(self, view):
>        return self._template(searchList=[{'view': views}]).respond()
>
> Where can I find recent tutorial on this subject? GrokTemplate has
> obviously been moved.

Correct. It is now in grokcore.view.components.  Take a look at:

http://mail.zope.org/pipermail/grok-dev/2009-January/006985.html

for some general instructions. If you're using the Grok 1.0 Alpha or
later, I believe that
grok.interfaces.ITemplateFileFactory should now be
grokcore.view.interfaces.ITemplateFileFactory too.

Thanks
Paul


More information about the Grok-dev mailing list