def remove(): """ This method removes an hash map. :param _id: MongoDB ObjectId """ _id = request.args.get("_id", None) page_object = Pages(_id=_id) success = False if _id: success = page_object.remove() data = {"success": success} return jsonify(data)
def new(): """ Create a new document within the hash table. """ params = request.json page_object = Pages(params=params) page_object.new() data = { "success": page_object.success, "message": page_object.message, "page": page_object.page } return jsonify(data)
def remove(): """ This method removes an hash map. :param _id: MongoDB ObjectId """ _id = request.args.get("_id", None) page_object = Pages(_id=_id) success = False if _id: success = page_object.remove() data = { "success": success } return jsonify(data)
def update(): """ """ params = request.json success = False message = "" page = {} if "_id" in params: page_object = Pages(params=params, _id=params["_id"]) page_object.update() success = page_object.success message = page_object.message page = page_object.page data = {"success": success, "message": message, "page": page} return jsonify(data)
def update(): """ """ params = request.json success = False message = "" page = {} if "_id" in params: page_object = Pages(params=params, _id=params["_id"]) page_object.update() success = page_object.success message = page_object.message page = page_object.page data = { "success": success, "message": message, "page": page } return jsonify(data)