Beispiel #1
0
def newCompo():
    content = request.json
    print("NewCompo Call")
    col = ["user_id", "description", "name"]
    values = [
        "'{}', '{}', '{}'".format(content['id'], content['description'],
                                  content['name'])
    ]
    MySQLConnect.insert("composition", ",".join(col), ",".join(values))
    return 'newCompoAdded'
Beispiel #2
0
def newMusicSheets():
    content = request.json
    print("newSheetMusic Call")
    col = ["composition_id", "name", "author", "tempo"]
    values = [
        "'{}', '{}', '{}', '{}'".format(content['comp_id'], content['name'],
                                        content['author'], content['tempo'])
    ]
    MySQLConnect.insert("sheet_music", ",".join(col), ",".join(values))
    return 'newMusicSheets'
Beispiel #3
0
def registerRoute():

    content = request.json
    print("RegisterRoute Call")
    col = ["email"]
    values = ["'{}'".format(content['email'])]
    check = MySQLConnect.findUser('user', content['email'])

    if len(check) == 0:
        MySQLConnect.insert("user", ",".join(col), ",".join(values))
    else:
        result = {"ok": "false", "id": -1}
        return jsonify(result)
    em = MySQLConnect.findByEmail('user', content['email'])
    result = {"ok": "true", "id": em[0][0]}
    return jsonify(result)