def process_request(self, req): """ this class maps "serializable" python classes to a dojo class to be able to use it in the Rpc request """ cls = self._get_class(self._get_class_name(req.path_info)) #dojo = to_dojo(cls()) c = cls() dojo = c.to_js() render_xd_classes(c.to_js(), req) if self._is_xd(req.path_info) else req.send(dojo, "application/json")
def _render_dojo_file(self, file, req): if file.endswith(".xd.js"): # Dojo Cross domain. we need to genereate the file #get the basic file file = file.replace(".xd.", ".") self._assert_file_exists(file) from tic.web.dojo import render_xd_classes return render_xd_classes(file, req) self._assert_file_exists(file) req.send_file(os.path.abspath(file))