Найти - Пользователи
Полная версия: pyjamas и jsonrpc
Начало » Web » pyjamas и jsonrpc
1
darvin11
не получается прикрутить pyjamas к джанге.


from pyjamas.JSONService import JSONProxy

class RemoteService(JSONProxy):
def __init__(self):
JSONProxy.__init__(self, "http://127.0.0.1:8000/json/",
["clients.getAll",
])


class LeftPanel(StackPanel):
'''
classdocs
'''


def __init__(self):
'''
Constructor
'''
StackPanel.__init__(self)

##...........
self.json_service = RemoteService()




def onClientsItemSelected(self, event):
print "select!"
self.json_service.clients.getAll()

def onRemoteResponse(self, response, request_info):
print "responce"
self.add(HTML("response: "+response))

def onRemoteError(self, code, message, request_info):
print "error"
self.add(HTML("error: "+message))
select пишет, a responce или error - нет.
джанга по адресу http://127.0.0.1:8000/json/ по методу “clients.getAll” отдает, проверял
в чем собака зарыта?
darvin11
заменил clients.getAll на clients_getAll в джанге и соответсвенно пижамах, теперь когда клиент обращается к джанге в консоли джанги нечто странное:
“OPTIONS /json/ HTTP/1.1” 400 394
“OPTIONS /json/ HTTP/1.1” 400 394
“OPTIONS /json/ HTTP/1.1” 400 394
“OPTIONS /json/ HTTP/1.1” 400 394
“OPTIONS /json/ HTTP/1.1” 400 394

ответа по прежнему не получаю
darvin11
нашел ошибку, надо было сделать self.json_service.clients_getAll(self), чтобы он хандлер подхватил. Однако, вылезла еще более дикая ошибка:
x.__mro__ is undefined
&& x.__mro__.length > y.__mro__.length
чтобы это вообще могло значить?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB