Example #1
0
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)
Example #2
0
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)
Example #3
0
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)
Example #4
0
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) 
Example #5
0
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)
Example #6
0
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)