Exemple #1
0
def input_player(db):
    print("Input required values and press enter...")
    p = Player()
    p.fullname = input("Fullname: ")
    p.position = input("Position: ")

    p.birth = check_input(input_date, "Date of birth (dd-mm-yyyy): ")

    p.value = check_input(input_num, "Market value: ")
    # print clubs
    p.club_id = check_input(input_club_id, "Please input club id that exists or 0: ", db)
    # print agents
    p.agent_id = check_input(input_agent_id, "Please input agent id that exists or 0: ", db)
    db.new_player(p)
Exemple #2
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)