def create_team():
    new_team = Team(team_name=request.form["team_name"],
                    location=request.form["location"],
                    stadium_name=request.form["stadium_name"],
                    stadium_capacity=request.form["stadium_capacity"],
                    fixtures_played=request.form["fixtures_played"],
                    fixtures_won=request.form["fixtures_won"],
                    fixtures_drawn=request.form["fixtures_drawn"],
                    fixtures_lost=request.form["fixtures_lost"],
                    points=request.form["points"],
                    score=request.form["score"])
    team_repository.save(new_team)
    return redirect("/clubs")
예제 #2
0
from models.team import Team
import repositories.team_repository as team_repository

from models.player import Player
import repositories.player_repository as player_repository

from models.game import Game
import repositories.game_repository as game_repository

team_repository.delete_all()
player_repository.delete_all()
game_repository.delete_all()

team_1 = Team("Grange Mens", "Commercial Water Solutions")
team_repository.save(team_1)
team_2 = Team("Grove Menzieshill Hockey", "Focus")
team_repository.save(team_2)
team_3 = Team("Western Wildcats", "Checkpoint Software Technologies")
team_repository.save(team_3)
team_4 = Team("Edinburgh University", "Aratac Hockey")
team_repository.save(team_4)
team_5 = Team("Clydesdale Hockey Club Mens", "Prosperity Financial Solutions")
team_repository.save(team_5)
team_6 = Team("Uddingston Hockey Club Mens", "Aratac Hockey")
team_repository.save(team_6)
team_7 = Team("Edinburgh University", "Deans Civil Engineering")
team_repository.save(team_7)
team_8 = Team("Kelburne Hockey Club Mens", "Cala Properties")
team_repository.save(team_8)
team_9 = Team("Dundee Wanderers Hockey Club Mens", "MJ Ventilation")
예제 #3
0
def create_team():
    name = request.form["name"]
    sponsor = request.form["sponsor"]
    new_team = Team(name, sponsor)
    team_repository.save(new_team)
    return redirect("/teams")
예제 #4
0
def create_team():
    team_name = request.form['create new team']

    team = Team(team_name)
    team_repository.save(team)
    return redirect('/teams')
예제 #5
0
def create_team():
    name = request.form['name']
    points = request.form['points']
    new_team = Team(name, points)
    team_repository.save(new_team)
    return redirect('/teams')
player_4 = Player(
    "Ronaldo (the Brazilian one!)",
    "O Fenômeno. But for injuries and illness, surely we would not be debating who was the greatest player of all time.",
    309)
player_repository.save(player_4)

player_5 = Player(
    "Zlatan Ibrahimovic",
    "As is his way, Zlatan has the best quotes about Zlatan: We usually say that you cannot become a legend before death. But I am a living legend.",
    470)
player_repository.save(player_5)

team_1 = Team("Napoli", "Naples, Italy", "Stadio San Paolo", 60000, 4, 0, 4, 0,
              4, 0)
team_repository.save(team_1)

team_2 = Team("Santos", "Sao Paulo, Brazil",
              "Estádio Urbano Caldeira (Vila Belmiro)", 16000, 4, 0, 4, 0, 4,
              0)
team_repository.save(team_2)

team_3 = Team("Juventus", "Turin, Italy", "Juventus Stadium", 41000, 4, 0, 4,
              0, 4, 2)
team_repository.save(team_3)

team_4 = Team("Barcelona", "Barcelona, Catalonia, Spain", "Camp Nou", 99000, 4,
              0, 4, 0, 4, 1)
team_repository.save(team_4)

team_5 = Team("AC Milan", "Milan, Italy", "Stadio Giuseppe Meazza (San Siro)",
예제 #7
0
import repositories.blacklist_token_repository as blacklist_token_repository

# Players
player_1 = Player("*****@*****.**", "password1", "John", "Smith",
                  "Hopp Suisse")
player_repository.save(player_1)
player_2 = Player("*****@*****.**", "password", "Stan", "H",
                  "Stantasy Football")
player_repository.save(player_2)

# Teams
team_1 = Team("Italy")
team_2 = Team("Switzerland")
team_3 = Team("Turkey")
team_4 = Team("Wales")
team_repository.save(team_1)
team_repository.save(team_2)
team_repository.save(team_3)
team_repository.save(team_4)

team_5 = Team("Belgium")
team_6 = Team("Denmark")
team_7 = Team("Finland")
team_8 = Team("Russia")
team_repository.save(team_5)
team_repository.save(team_6)
team_repository.save(team_7)
team_repository.save(team_8)

team_9 = Team("Austria")
team_10 = Team("Netherlands")
예제 #8
0
def create_team():
    team_name = request.form['team_name']
    league_id = 1
    team = Team(team_name, league_id)
    team_repository.save(team)
    return redirect('/teams')
예제 #9
0
import pdb

from models.fixture import Fixture

from models.team import Team

import repositories.fixture_repository as fixture_repository
import repositories.team_repository as team_repository

fixture_repository.delete_all()
team_repository.delete_all()

team1 = Team("Hibs")
team_repository.save(team1)

team2 = Team("Hearts")
team_repository.save(team2)

team3 = Team("Celtic")
team_repository.save(team3)

team4 = Team("GB")
team_repository.save(team4)

fixture1 = Fixture(team1, team2)
fixture_repository.save(fixture1)

fixture2 = Fixture(team3, team4)
fixture_repository.save(fixture2)

pdb.set_trace()
예제 #10
0
def new_team():
    post_data = request.get_json()
    team = Team(post_data.get('name'))
    team_repository.save(team)
    return make_response(jsonify(team.__dict__)), 201