コード例 #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)