Exemplo n.º 1
0
def get_attributes(arr, att):
    """ pair column description/attributes with values """
    print_stars()
    for elm in arr:
        for i, element in enumerate(att):
            print("%s: %s" % (element, elm[i]))
        print_stars()
Exemplo n.º 2
0
 def ask_details():
     print_stars()
     first = Member.first_name()
     last = Member.last_name()
     phone = Member.phone_number()
     email = Member.email()
     return first, last, phone, email
Exemplo n.º 3
0
def com_close():  #to add error checking
    """ commit and close db """
    print_stars()
    CONNECTION.commit()
    print("changes commited to db")
    CONNECTION.close()
    print("connection to db closed. no errors")
Exemplo n.º 4
0
def delete_member():
    """ self explanatory """
    first, last = Member.ask_name()
    print_stars()

    to_be_or_not = MemberFunc(first, last)

    if not to_be_or_not.already_member():
        print("Member doesnt exist. q to quit or m for main menu")
        user_input = input()
        quit_or_menu(user_input)
    else:
        to_be_or_not.view_matches()
        id_to_del = to_be_or_not.id_to_del()
        run_del(id_to_del)
        com_close()
Exemplo n.º 5
0
def update_member():
    """ self explanatory """
    print_stars()
    print("Previous first and last name to update")
    print_stars()
    first_name, last_name = Member.ask_name()

    to_be_or_not = MemberFunc(first_name, last_name)

    if not to_be_or_not.already_member():
        print("Member doesnt exist. q to quit or m for main menu")
        user_input = input()
        quit_or_menu(user_input)
    else:
        to_be_or_not.view_matches()
        id_to_del = to_be_or_not.id_to_del()
        print("Insert NEW details:")
        run_update(first_name, last_name, id_to_del)
        com_close()