예제 #1
0
def newMatchEvent():
    if request.form.get('ename') is None:
        e = matchEventList()
        e.set('ename', '')
        e.set('estat', '')
        e.set('etime', '')
        e.set('pid', '')
        e.set('gid', '')
        e.set('tid', '')
        e.add()

        allPlayers = playerList()
        allPlayers.getByTeam()

        allGames = gameList()
        allGames.getByTeam()

        allTeams = teamList()
        allTeams.getAll()

        return render_template('matchEvent/newMatchEvent.html',
                               title='New matchEvent',
                               matchEvent=e.data[0],
                               pl=allPlayers.data,
                               gl=allGames.data,
                               tl=allTeams.data)
    else:
        e = matchEventList()
        e.set('ename', request.form.get('ename'))
        e.set('estat', request.form.get('estat'))
        e.set('etime', request.form.get('etime'))
        e.set('pid', request.form.get('pid'))  #possible problem with naming
        e.set('gid', request.form.get('gid'))
        e.set('tid', request.form.get('tid'))
        e.add()
        allPlayers = playerList()
        allPlayers.getByTeam()

        allGames = gameList()
        allGames.getByTeam()

        allTeams = teamList()
        allTeams.getAll()
        if e.verifyNew():
            e.insert()
            print(e.data)
            return render_template('matchEvent/savedMatchEvent.html',
                                   title='matchEvent Saved',
                                   matchEvent=e.data[0])
        else:
            return render_template('matchEvent/newMatchEvent.html',
                                   title='matchEvent Not Saved',
                                   matchEvent=e.data[0],
                                   msg=e.errorList,
                                   pl=allPlayers.data,
                                   gl=allGames.data,
                                   tl=allTeams.data)
예제 #2
0
def saveMatchEvent():
    e = matchEventList()
    e.set('eid', request.form.get('eid'))
    e.set('ename', request.form.get('ename'))
    e.set('estat', request.form.get('estat'))
    e.set('etime', request.form.get('etime'))
    e.set('pid', request.form.get('pid'))
    e.set('gid', request.form.get('gid'))
    e.set('tid', request.form.get('tid'))
    e.add()
    allPlayers = playerList()
    allPlayers.getByTeam()

    allGames = gameList()
    allGames.getByTeam()

    allTeams = teamList()
    allTeams.getAll()
    if e.verifyChange():
        e.update()
        print(e.data)
        #return ''
        return render_template('matchEvent/savedMatchEvent.html',
                               title='matchEvent Saved',
                               matchEvent=e.data[0])
    else:
        return render_template('matchEvent/matchEvent.html',
                               title='matchEvent Not Saved',
                               matchEvent=e.data[0],
                               msg=e.errorList,
                               pl=allPlayers.data,
                               gl=allGames.data,
                               tl=allTeams.data)
예제 #3
0
def matchEvent():
    e = matchEventList()

    allPlayers = playerList()
    allPlayers.getByTeam()

    allGames = gameList()
    allGames.getByTeam()

    allTeams = teamList()
    allTeams.getAll()

    if request.args.get(e.pk) is None:
        return render_template('error.html', msg='No matchEvent id given')

    e.getById(request.args.get(e.pk))
    if len(e.data) <= 0:
        return render_template('error.html', msg='matchEvent not found')

    print(e.data)
    #return ''
    return render_template('matchEvent/matchEvent.html',
                           title='matchEvent',
                           matchEvent=e.data[0],
                           pl=allPlayers.data,
                           gl=allGames.data,
                           tl=allTeams.data)
예제 #4
0
def players():
    p = playerList()
    p.getAll()
    p.getByTeam()

    print(p.data)
    #return ''
    return render_template('player/players.html',
                           title='Player List',
                           players=p.data)
예제 #5
0
def newplayer():
    if request.form.get('pname') is None:
        p = playerList()
        p.set('pname', '')
        p.set('age', '')
        p.set('position', '')
        p.set('tid', '')
        p.add()
        allTeams = teamList()
        allTeams.getAll()

        return render_template('player/newplayer.html',
                               title='New Player',
                               player=p.data[0],
                               tl=allTeams.data)
    else:
        p = playerList()
        p.set('pname', request.form.get('pname'))
        p.set('age', request.form.get('age'))
        p.set('position', request.form.get('position'))
        p.set('tid', request.form.get('tid'))  #possible problem with naming
        p.add()
        allTeams = teamList()
        allTeams.getAll()
        if p.verifyNew():
            p.insert()
            print(p.data)
            return render_template('player/savedplayer.html',
                                   title='Player Saved',
                                   player=p.data[0])
        else:
            return render_template('player/newplayer.html',
                                   title='Player Not Saved',
                                   player=p.data[0],
                                   msg=p.errorList,
                                   tl=allTeams.data)
예제 #6
0
def player():
    p = playerList()
    allTeams = teamList()
    allTeams.getAll()
    if request.args.get(p.pk) is None:
        return render_template('error.html', msg='No player id given')

    p.getById(request.args.get(p.pk))
    if len(p.data) <= 0:
        return render_template('error.html', msg='Player not found')

    print(p.data)
    #return ''
    return render_template('player/player.html',
                           title='Player',
                           player=p.data[0],
                           tl=allTeams.data)
예제 #7
0
 def __init__(self):
     # setup some constants here
     self.gameName = "GIBSON'S WHEEL!"
     self.vowelCost = 250
     self.houseMinimum = 1000
     self.numRegularRounds = 3
     # setup some regex's for use as needed
     self.re_alpha = re.compile('[A-Za-z]')
     self.re_vowel = re.compile('[AEIOUaeiou]')
     self.re_num   = re.compile('[0-9]')
     # start gameplay with a splash screen
     self.printWelcome()
     # instantiate the wheel, puzzle list, and players (not the board, re-instantiate it each round)
     self.wheel = wheel.wheel()
     self.puzzles = puzzles.puzzleList()
     self.players = player.playerList()
     # play a game
     self.playGame()
     # maybe like "Thanks for playing!"
     self.endGame()
예제 #8
0
 def __init__(self):
     # setup some constants here
     self.gameName = "GIBSON'S WHEEL!"
     self.vowelCost = 250
     self.houseMinimum = 1000
     self.numRegularRounds = 3
     # setup some regex's for use as needed
     self.re_alpha = re.compile('[A-Za-z]')
     self.re_vowel = re.compile('[AEIOUaeiou]')
     self.re_num = re.compile('[0-9]')
     # start gameplay with a splash screen
     self.printWelcome()
     # instantiate the wheel, puzzle list, and players (not the board, re-instantiate it each round)
     self.wheel = wheel.wheel()
     self.puzzles = puzzles.puzzleList()
     self.players = player.playerList()
     # play a game
     self.playGame()
     # maybe like "Thanks for playing!"
     self.endGame()
예제 #9
0
def saveplayer():
    p = playerList()
    p.set('pid', request.form.get('pid'))
    p.set('pname', request.form.get('pname'))
    p.set('age', request.form.get('age'))
    p.set('position', request.form.get('position'))
    p.set('tid', request.form.get('tid'))
    p.add()
    allTeams = teamList()
    allTeams.getAll()
    if p.verifyChange():
        p.update()
        print(p.data)
        #return ''
        return render_template('player/savedplayer.html',
                               title='Player Saved',
                               player=p.data[0])
    else:
        return render_template('player/player.html',
                               title='Player Not Saved',
                               player=p.data[0],
                               msg=p.errorList,
                               tl=allTeams.data)