Re: Ajax with JSON-RPC -- new Django handler

2009-07-10 Thread djfis...@gmail.com
According to the jsonrpc 1.1 working draft, the request type and response should be application/json not application/javascript. Even if you handle requests that are in other types for compatibility, you probably want your responses to be the correct type. http://json-rpc.org/wd/JSON-RPC-1-1-WD-2

Re: Ajax with JSON-RPC -- new Django handler

2009-07-10 Thread BenW
I fixed the above problem with URL reversing by refactoring the JSONRPCService.__call__ method to grab it from the request object. def __call__(self, request, extra=None): if request.method == "POST": return HttpResponse(self.process(request), mimetype="ap

Re: Ajax with JSON-RPC -- new Django handler

2009-07-09 Thread BenW
Sorry for digging up this thread but I fell off the list a bit and just checked back today. I really like the Pyjamas jsonprc implementation. In fact, I like it so much I've gone ahead and modified a few things to do the SMD generation and service URL resolution. However, I have a problem with

Re: Ajax with JSON-RPC -- new Django handler

2009-06-19 Thread lkcl
ok, i added a copy of the code to the wiki page, as some people may find that easier to access and evaluate rather than from some other random google group page. l. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: Ajax with JSON-RPC -- new Django handler

2009-06-18 Thread lkcl
On Jun 3, 5:14 pm, BenW wrote: > I just posted a JSON-RPC handler I've been working with on the wiki: > > http://code.djangoproject.com/wiki/Jsonrpc > > I'd be interested in feedback from anyone doing async javascript with > Django over RPC. ben, hi, there are many jsonrpc implementations.

Re: Ajax with JSON-RPC -- new Django handler

2009-06-18 Thread Adi Andreias
This module could be useful, but there are all sort of problems in code. Like, __public__ = True you meant: self.__public__ = True ? After fixing that I get: AttributeError: 'tuple' object has no attribute 'args' on line return [ a for a in getargspec(self.method).args if (a != "self") ] This c

Re: Ajax with JSON-RPC -- new Django handler

2009-06-04 Thread BenW
I made a few changes to make it a bit more general-purpose. It now uses @publicmethod instead of the horrific public__ notation. However, the dispatcher class just checks if method.__class__.__name__ == 'publicmethod' and __public__ == True inside it. This seems a bit odd but I'm not sure how to

Re: Ajax with JSON-RPC -- new Django handler

2009-06-04 Thread BenW
Ahh yes, I had not considered calling them from Python since in my use case they are treated more like an extension into the browser than anything else. I will definitely refactor the class to use @publicmethod so as to make the instance containing RPC methods more general-purpose. Thanks for th

Re: Ajax with JSON-RPC -- new Django handler

2009-06-04 Thread Artem Egorkine
On Wed, Jun 3, 2009 at 9:18 PM, BenW wrote: > > Sorry about the example having bad syntax (doh!) -- I will get that > fixed. I chose the public__ prefix because it makes it easier to > introspect the supplied instance to find the methods intended to be > public without forcing users of the class

Re: Ajax with JSON-RPC -- new Django handler

2009-06-03 Thread BenW
Sorry about the example having bad syntax (doh!) -- I will get that fixed. I chose the public__ prefix because it makes it easier to introspect the supplied instance to find the methods intended to be public without forcing users of the class to provide a list themselves. You can put the class a

Re: Ajax with JSON-RPC -- new Django handler

2009-06-03 Thread Alex Gaynor
On Wed, Jun 3, 2009 at 12:14 PM, BenW wrote: > > I just posted a JSON-RPC handler I've been working with on the wiki: > > http://code.djangoproject.com/wiki/Jsonrpc > > I'd be interested in feedback from anyone doing async javascript with > Django over RPC. > > Thanks! > > Ben > > > > a) This cod