def update_main_cell_ndfi(z, x, y): r = Report.current() cell = Cell.get_or_create(r, x, y, z) deferred.defer(ndfi_value_for_cells, str(cell.key()), _queue="ndfichangevalue") return 'working'
def create(self, report_id, cell_pos): r = Report.get(Key(report_id)) z, x, y = Cell.cell_id(cell_pos) cell = Cell.get_or_create(r, x, y, z) data = json.loads(request.data) if 'msg' not in data: abort(400) a = Note(msg=data['msg'], added_by=users.get_current_user(), cell=cell) a.save() return Response(a.as_json(), mimetype='application/json')
def create(self, report_id, cell_pos): r = Report.get(Key(report_id)) z, x, y = Cell.cell_id(cell_pos) cell = Cell.get_or_create(r, x, y, z) data = json.loads(request.data) if "msg" not in data: abort(400) a = Note(msg=data["msg"], added_by=users.get_current_user(), cell=cell) a.save() return Response(a.as_json(), mimetype="application/json")
def create(self, report_id, cell_pos): r = Report.get(Key(report_id)) z, x, y = Cell.cell_id(cell_pos) cell = Cell.get_or_create(r, x, y, z) data = json.loads(request.data) a = Area(geo=json.dumps(data["paths"]), type=data["type"], added_by=users.get_current_user(), cell=cell) a.save() cell.last_change_by = users.get_current_user() cell.put() return Response(a.as_json(), mimetype="application/json")
def create(self, report_id, cell_pos): r = Report.get(Key(report_id)) z, x, y = Cell.cell_id(cell_pos) cell = Cell.get_or_create(r, x, y, z) data = json.loads(request.data) a = Area(geo=json.dumps(data['paths']), type=data['type'], added_by=users.get_current_user(), cell=cell) a.save() cell.last_change_by = users.get_current_user() cell.put() return Response(a.as_json(), mimetype='application/json')