On Nov 8, 2010, at 2:15 PM, Felipe De Siqueira wrote: > I'm really excited about using pyjamas with pyramid/pylons in this manner so > if I figure it out maybe I'll beat you to it :-). > > And then of course you can tell me how to make it better! > > On Mon, Nov 8, 2010 at 2:01 PM, Christoph Zwerschke <[email protected]> wrote: > Creating a JSONRPC extension, paster templates and a chapter in the docs for > using Pyramid with Pyjamas would be great. It's already on my todolist, but > not so high. I hope that somebody can beat me to it.
We have pyramid_xmlrpc, but it doesn't really let you extend very easily as it doesn't use the view lookup machinery to locate the appropriate code for a xmlrpc method, rather it uses a view class with __call__. So I started on a pyramid_rpc (to have a new version of xml-rpc, and json-rpc): https://github.com/Pylons/pyramid_rpc Since I needed to rig it up for the view lookup, the only diff from having it be json-rpc is how the method name is located, so it should be trivial to adapt it for use with json-rpc. I hope to get back to working on it a bit more shortly, if some other people want to dive in, that'd be wonderful too. Though since it does make use of some deeper pyramid lookup stuff, that might scare some. :) But it should make it really easy to write out dozens of json-rpc methods with ease, ie: @jsonrpc() def view_all(request): args = request.jsonargs return {'some': 'reply'} And assuming you had done: config.add_route('JRPC', '/api/jsonrpc', view=jsonrpc_endpoint) It'd all 'just work'. Cheers, Ben -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
