[Grok-dev] Re: shortcut to methods

Martijn Faassen faassen at startifact.com
Mon Mar 19 10:40:20 EDT 2007

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.

If you have other use cases besides JSON for MethodViews, please share 
them with us.



More information about the Grok-dev mailing list