def get(self, n): try: n = int(n) except ValueError: n = RETRIEVE_DEFAULT_NR if n <= 0: n = RETRIEVE_DEFAULT_NR todoList = TodoModel.retrieve_last_N_items(n) return jsonify({ 'success': True, 'todoList': [{'text': item} for item in todoList] })
def get(self, n): try: n = int(n) except ValueError: n = RETRIEVE_DEFAULT_NR if n <= 0: n = RETRIEVE_DEFAULT_NR todoList = TodoModel.retrieve_todos(n) return jsonify({ 'success': True, 'todoList': [{ 'id': item[0], 'text':item[1], 'value':item[2] } for item in todoList] })
def get(self, n): try: n = int(n) except ValueError: n = RETRIEVE_DEFAULT_NR if n <= 0: n = RETRIEVE_DEFAULT_NR todoList = TodoModel.retrieve_last_N_items(n) return jsonify({ 'success': True, 'todoList': [{ 'text': item } for item in todoList] })
def get(self, n): try: n = int(n) except ValueError: n = RETRIEVE_DEFAULT_NR if n <= 0: n = RETRIEVE_DEFAULT_NR todoList = TodoModel.retrieve_todos(n) return jsonify({ 'success': True, 'todoList': [{ 'id': item[0], 'text': item[1], 'value': item[2] } for item in todoList] })
def post(self): args = json.loads(request.data) TodoModel.add_item(args['item']) return jsonify({'success': True})
def post(self): args = json.loads(request.data) print("Changed done value to:", args) TodoModel.add_value(args['id'], args['value']) return jsonify({'success': True})
def post(self): args = json.loads(request.data) print("Changed done value to:", args) TodoModel.add_value(args['id'], args['value']) return jsonify({'success' : True})