Ejemplo n.º 1
0
def downloadMap():
    mapID = int(request.form['id'])
    dac = database_access()
    result = dac.get_map_with_items(mapID)
    if (result):
        return result
    else:
        return jsonify(result="Map Not Found")
Ejemplo n.º 2
0
def incrementLevel():
    current = int(request.form['mapid'])
    print ("Map " + str(current) + " completed")
    new = current
    dac = database_access()
    maximum = dac.get_number_of_levels()
    if (current < maximum):
        new = current + 1
    if current_user.is_authenticated():
        dac.update_user_level(current_user.username, new)
    return jsonify(level=new)
Ejemplo n.º 3
0
db.session.add(mi)
mi = MapItems(3,2,7,1)
db.session.add(mi)
mi = MapItems(3,2,13,11)
db.session.add(mi)
mi = MapItems(3,3,16,3)
db.session.add(mi)

U = User("SkyBear", "my_token", "my_secret", 5)
db.session.add(U)


db.session.add(mi)
db.session.commit()

DAC = database_access()

result = DAC.get_user("SkyBear").level
print ("Highest Level: " + str(result))



#getting the map with id 1
#m = db.session.query(Maps).get(1)

#automatically does the join on the map_items table to pull together the result
#item_list = m.items

print ("**********************************\n")

print ("Single map Query through database access: \n")
Ejemplo n.º 4
0
def alllevels():
    dac = database_access()
    response = dac.get_number_of_levels()
    return jsonify(result=response)