[Grok-dev] Re: shortcut to methods
Philipp von Weitershausen
philipp at weitershausen.de
Mon Mar 19 13:58:29 EDT 2007
Martijn Faassen wrote:
> Christian Theune wrote:
> Tim wrote:
> > > The implementation is almost already there as the xmlrpc grokker
> > > uses this approach.
>> Our XMLRPC view class already does this. Maybe you can take a look at
>> that implementation to get something for json?
> Please do note that a few months ago I tried exactly this and got
> terribly lost in the zope publishing machinery, and gave up. I do really
> want such a feature for JSON though, and perhaps you can come up with an
> approach that makes it work.
> Note also that instead of 'MethodViews' I think you should go all the
> way, and have a grok.JSON view instead, analogous to grok.XMLRPC. This
> would take care of serialization of return values to JSON automatically,
> instead of you having to write simplejson.dumps(self.json) in every
> single method.
Note that there's already something like that in the jsonserver package
(http://codespeak.net/svn/z3/jsonserver/trunk/). Perhaps that can be
cleaned up, eggified and simply used as a dependency.
http://worldcookery.com -- Professional Zope documentation and training
More information about the Grok-dev