def roll_dice(room, number): roll = [randint(1, 6)] i = 1 while i < int(number): roll.append(randint(1, 6)) i+=1 dice ={"dice": roll} dicerolls = Dicerolls(dice_roll = str(dice), room = room) dicerolls.put() return json.dumps(dice)
def show_room(room): dicerolls = Dicerolls.all() return render_template('room.html', dicerolls=dicerolls, room=room)