コード例 #1
0
def input_club(db):
    print("Input required values and press enter...")
    c = Club()
    c.title = input("Title: ")
    c.coach = input("Coach: ")
    c.league = input("League: ")
    c.euro_cups = input("Is club plays at euro cups (True or False): ") == "True"
    db.new_club(c)
コード例 #2
0
def update_club(db, id):
    club = db.get_club_id(id)

    print("Input required values and press enter...")
    new_c = Club()
    inp = input("Coach: ")
    new_c.coach = inp if inp is not '' else club[2]
    inp = input("League: ")
    new_c.league = inp if inp is not '' else club[3]
    inp = input("Is club plays at euro cups (True or False): ")
    new_c.euro_cups = inp == "True" if inp is not '' else club[4]
    db.update_club(new_c, id)
コード例 #3
0
def update_club(db, id):
    club = db.get_club_id(id)

    print("Input required values and press enter...")
    coach = input("Coach: ")
    league = input("League: ")
    euro = input("Is club plays at euro cups (True or False): ")
    new_c = Club(title=club.title,
                 coach=coach if coach is not '' else club.coach,
                 league=league if league is not '' else club.league,
                 euro_cups=euro == "True" if euro is not '' else club[4])
    db.update_club(new_c)
コード例 #4
0
def input_player(db):
    print("Input required values and press enter...")
    p = Player(
        fullname=input("Fullname: "),
        market_value=check_input(input_num, "Market value: "),
        birth=check_input(input_date, "Date of birth (dd-mm-yyyy): "),
        pos=input("Position: "),
        club_id=check_input(input_club_id,
                            "Please input club id that exists or 0: ", db),
        agent_id=check_input(input_agent_id,
                             "Please input agent id that exists or 0: ", db))
    db.new_player(p)
コード例 #5
0
def update_player(db, id):
    # select cols to update
    # input(col)
    player = db.get_player_id(id)
    print("Input required values and press enter...")
    new_p = Player()
    inp = input("Position: ")
    new_p.position = inp if inp is not '' else player[4]

    new_p.value = check_input(input_num, "Market value: ")
    # print clubs
    new_p.club_id = check_input(input_club_id, "Please input club id: ", db)
    # print agents
    new_p.agent_id = check_input(input_agent_id, "Please input agent id: ", db)
    db.update_player(new_p, id)
コード例 #6
0
def update_player(db, id):
    # select cols to update
    # input(col)
    player = db.get_player_id(id)
    print("Input required values and press enter...")
    inp = input("Position: ")
    new_p = Player(fullname=player.fullname,
                   market_value=check_input(input_num, "Market value: "),
                   birth=player.birth,
                   pos=inp if inp is not '' else player.pos,
                   club_id=check_input(input_club_id, "Please input club id: ",
                                       db),
                   agent_id=check_input(input_agent_id,
                                        "Please input agent id: ", db))
    db.update_player(new_p)
コード例 #7
0
def input_agent(db):
    print("Input required values and press enter...")
    a = Agent()
    a.fullname = input("Fullname: ")
    a.salary = check_input(input_num, "Salary: ")
    db.new_agent(a)