Example #1
0
def outfitPage(dsn,id):
    outfits=outfitTable.outfits(dsn)
    if request.method == 'GET':
        now = datetime.datetime.now()
        datas= outfits.select_outfits(id);
        ts=teams.Teams(dsn)
        tDatas=ts.select_teams()
        page= render_template('outfit.html', current_time=now.ctime(),
                              rows=datas, update = False,TeamID=id,
                              teamSelect=tDatas,
                              )
        outfits.close_con();
        return page
    elif 'Add' in request.form:
        teamID=request.form['Team']
        link=request.form['Link']

        outfits.add_outfits(teamID,link)

        outfits.close_con()
        return redirect(url_for('outfitpage',id=id))
    elif 'Delete' in request.form:
        keys = request.form.getlist('movies_to_delete')
        for key in keys:
            outfits.delete_outfits(key)
        outfits.close_con()
        return redirect(url_for('outfitpage',id=id))
    elif 'Update' in request.form:
        keys = request.form.getlist('movies_to_delete')
        for key in keys:
           link=request.form['ULink'+key]
           outfits.update_outfits(link,key)
        outfits.close_con()
        return redirect(url_for('outfitpage',id=id))
Example #2
0
def outfitPageUpdate(dsn,id):
    outfits=outfitTable.outfits(dsn)
    if request.method == 'GET':
        now = datetime.datetime.now()
        datas= outfits.select_outfits(id);
        ts=teams.Teams(dsn)
        tDatas=ts.select_teams()
        page= render_template('outfit.html', current_time=now.ctime(),
                              rows=datas, update = True,TeamID=id,
                              teamSelect=tDatas,
                              )
        outfits.close_con();
        return page
Example #3
0
def InitPageFunc(dsn):
    for x in range(0, 2):
        playerTable = players.Players(dsn)
        playerTable.create_table()
        playerTable.close_con()
        userTable = users.Users(dsn)
        userTable.create_table()
        userTable.close_con()
        sponsorTable = sponsors.Sponsors(dsn)
        sponsorTable.create_table()
        sponsorTable.close_con()
        natTable = nats.Nats(dsn)
        natTable.create_table()
        natTable.close_con()
        statTable = stats.Stats(dsn)
        statTable.create_table()
        statTable.close_con()
        teamTable = teams.Teams(dsn)
        teamTable.create_table()
        teamTable.close_con()
        leagueTable = leagues.Leagues(dsn)
        leagueTable.create_table()
        leagueTable.close_con()
        coachTable = coaches.Coaches(dsn)
        coachTable.create_table()
        coachTable.close_con()
        stadiumTable = stadiums.Stadiums(dsn)
        stadiumTable.create_table()
        stadiumTable.close_con()
        matchTable = matches.Matches(dsn)
        matchTable.create_table()
        matchTable.close_con()
        betrateTable = betrates.Betrates(dsn)
        betrateTable.create_table()
        betrateTable.close_con()
        commentTable = comments.Comments(dsn)
        commentTable.create_table()
        commentTable.close_con()
        playerHis = playerHistory.playerHistory(dsn)
        playerHis.create_table()
        playerHis.close_con()
        outfittable = outfitTable.outfits(dsn)
        outfittable.create_table()
        outfittable.close_con()
        likeTable = likes.Likes(dsn)
        likeTable.create_table()
        likeTable.close_con()

    return HomePage.HomePageFunc()
Example #4
0
def outfitPageUpdate(dsn, id):
    outfits = outfitTable.outfits(dsn)
    if request.method == 'GET':
        now = datetime.datetime.now()
        datas = outfits.select_outfits(id)
        ts = teams.Teams(dsn)
        tDatas = ts.select_teams()
        page = render_template(
            'outfit.html',
            current_time=now.ctime(),
            rows=datas,
            update=True,
            TeamID=id,
            teamSelect=tDatas,
        )
        outfits.close_con()
        return page
Example #5
0
def outfitPage(dsn, id):
    outfits = outfitTable.outfits(dsn)
    if request.method == 'GET':
        now = datetime.datetime.now()
        datas = outfits.select_outfits(id)
        ts = teams.Teams(dsn)
        tDatas = ts.select_teams()
        page = render_template(
            'outfit.html',
            current_time=now.ctime(),
            rows=datas,
            update=False,
            TeamID=id,
            teamSelect=tDatas,
        )
        outfits.close_con()
        return page
    elif 'Add' in request.form:
        teamID = request.form['Team']
        link = request.form['Link']

        outfits.add_outfits(teamID, link)

        outfits.close_con()
        return redirect(url_for('outfitpage', id=id))
    elif 'Delete' in request.form:
        keys = request.form.getlist('movies_to_delete')
        for key in keys:
            outfits.delete_outfits(key)
        outfits.close_con()
        return redirect(url_for('outfitpage', id=id))
    elif 'Update' in request.form:
        keys = request.form.getlist('movies_to_delete')
        for key in keys:
            link = request.form['ULink' + key]
            outfits.update_outfits(link, key)
        outfits.close_con()
        return redirect(url_for('outfitpage', id=id))