[Kss-devel] kss with pylons
Walter Cruz
waltercruz at threepointsweb.com
Sat Mar 22 14:31:08 CET 2008
Hi Godefroid!
I develop plone apps, so I knew kss there. But find the kss.pylons was
hard, I found it listing the repositories.
I'm testing various things in the zope/plone3 world. Zope and Plone
are becoming closer to Python, and use some parts of it with another
projects is very fine! With KSS I can make my javascript less ugly,
and can integrate it with my framework pretty straighford.
My code is all prefixed with kss, cause it's a route map to my
controller. A note about the port: The Jeroen version had 2 versions
for the controllers, one to plain http requests, other for
xmlhttprequests. The controllers were prretty similar, except that one
returned a rendered page, and other returned a kss set of command.
I added a patch, described at http://kssproject.org/bugs/25 (just one
line:) ) and with this patch, I can do the something like the
following insise my Pylons controller:
def mycontroller():
make_common_actions()
if request.is_xhr:
return ksscomands
else
return a_rendered_template
With this, I can eliminate one of the controllers and make my app more DRY :)
--
Atenciosamente
Walter Rodrigo de Sá Cruz
waltercruz at threepointsweb.com
http://www.threepointsweb.com
+55 61 3468-1604
Python, Zope e Plone com quem entende do assunto
More information about the Kss-devel
mailing list