[Grok-dev] Re: A Django-like admin in Grok
kevin at mcweekly.com
Thu Apr 24 18:57:17 EDT 2008
Martijn Faassen wrote:
> On a slightly unrelated topic:
> How hard is it to use Django templating outside of Django? Is it a
> seperate library? If so, it wouldn't be too hard to integrate this
> into a Grok extension, as we have a pluggable templating language
> system. We could throw in this adaptation bit too. :)
Once upon a time I played with porting DJango templates to Zope3. It
worked, but since DJango templates were not separated out from the rest
of their packages, it didn't seem worth the time to maintain an
independent branch. Especially since it's quite limited(crippled) in
it's power and flexibility.
I recommend checking out Jinja
From their pypi page:
Jinja is a sandboxed
template engine written in pure Python. It provides a Django
<http://www.djangoproject.com/> like non-XML syntax and compiles
templates into executable python code. It's basically a combination
of Django templates and python code.
Also, it seems many people are enamored with DJango Template filters and
tags, which are very easy in to do in grok.
from zope.traversing.interfaces import IPathAdapter
from zope.tales.interfaces import ITALESFunctionNamespace
grok.name('myfilter') # name to access 'filter'
return ' '.join([x.capitalize() for x in self.context.split()])
<span tal:replace="context/title/myfilter:upper" />
> I think having this would be great, as I've heard people say good
> things about the Django templating language. Having this would also
> make it easier for people familiar with Django to learn Grok.
Jinja shouldn't be a big leap, very similar syntax and usage, just a
little more power and flexibilty, and alot more maintainability.
> Grok-dev mailing list
> Grok-dev at zope.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Grok-dev