Ejemplo n.º 1
0
 def render(self, req): 
     """
     Delete one or more cells.
     """
     #XXX untested - javascript doesn't work right now to delete a cell?
     cellids = json.loads(req.args.get('cellids', [None])[0])
     d = defer.maybeDeferred(self.notebook_db.delete_cells,
             cellids)
     d.addCallback(self._success)
     return d
Ejemplo n.º 2
0
 def render(self, request):
     orderlist = request.args.get('orderlist', [])
     orderlist = ','.join(orderlist)
     cellsdata = request.args.get('cellsdata', [None])[0]
     cellsdata = json.loads(cellsdata)
     d = defer.maybeDeferred(self.notebook_db.save_notebook_metadata,
             orderlist, cellsdata)
     d.addCallback(self._success)
     d.addErrback(self._failed)
     return d
Ejemplo n.º 3
0
 def render(self, request):
     orderlist = ",".join(request.args.get('orderlist', []))
     cellsdata = request.args.get('cellsdata', [None])[0]
     cellsdata = json.loads(cellsdata)
     result = yield defer.maybeDeferred(self.notebook_db.save_notebook_metadata,
             orderlist, cellsdata)
     resp = "{'resource':'%s', 'resp':'ok'}" % self.__class__.__name__
     jsobj = json.dumps(resp)
     request.setHeader("content-type", "application/json")
     request.write(jsobj)
     request.finish()
Ejemplo n.º 4
0
 def render(self, req): 
     """
     Delete one or more cells.
     """
     #XXX untested - javascript doesn't work right now to delete a cell?
     cellids = json.loads(req.args.get('cellids', [None])[0])
     result = yield defer.maybeDeferred(self.notebook_db.delete_cells, cellids)
     resp = "{'resource':'%s', 'resp':'ok'}" % self.__class__.__name__
     jsobj = json.dumps(resp)
     request.setHeader("content-type", "application/json")
     request.write(jsobj)
     request.finish()