Example #1
0
def add(table):
    """
    Asks user for input and adds it into the table.

    Args:
        table: table to add new record to

    Returns:
        Table with a new record
    """

    while True:
        returnable_list = common.common_add(table, menu_list)

        if (returnable_list[-1][1]).isdigit() == False and \
            (returnable_list[-1][2]).isdigit() and \
            (returnable_list[-1][3]).isdigit() and \
            int((returnable_list[-1][3])) > 0 and \
            int((returnable_list[-1][3])) < 13 and \
            (returnable_list[-1][4]).isdigit() and\
            int((returnable_list[-1][4])) > 0 and \
            int((returnable_list[-1][4])) < 32 and \
            (returnable_list[-1][5]).isdigit() and \
            int((returnable_list[-1][5])) < 3000 and \
                int((returnable_list[-1][5])) > 0:
            return returnable_list
        else:
            the_list.remove(the_list[-1])
            ui.print_error_message("\nYou entered wrong inputs\n")
Example #2
0
def add(table):
    while True:
        returnable_list = common.common_add(table, menu_list)

        if (returnable_list[-1][1]).isdigit() == False and (
                returnable_list[-1][2]).isdigit():
            return returnable_list
        else:
            the_list.remove(the_list[-1])
            ui.print_error_message("\nYou entered wrong inputs\n")
Example #3
0
def add(table):
    while True:
        returnable_list = common.common_add(table, menu_list)

        if (returnable_list[-1][1]).isdigit() and \
            (returnable_list[-1][5]).isdigit() and \
            (returnable_list[-1][4]) == "in" or (returnable_list[-1][4]) == "out" and \
            int((returnable_list[-1][1])) > 0 and \
            int((returnable_list[-1][1])) < 13 and \
            (returnable_list[-1][2]).isdigit() and \
            int((returnable_list[-1][2])) > 0 and \
            int((returnable_list[-1][2])) < 32 and \
            (returnable_list[-1][3]).isdigit() and \
            int((returnable_list[-1][3])) < 3000 and \
                int((returnable_list[-1][3])) > 0:
            return returnable_list
        else:
            the_list.remove(the_list[-1])
            ui.print_error_message("\nYou enteWred wrong inputs\n")
def add(table):
    module_headers = ["Month: ", "Day: ", "Year: ", "Type: ", "Amount: "]
    return common.common_add(table, module_headers)
def add(table):
    module_headers = [
        "Name: ", "Manufacturer: ", "Purchase date: ", "Durability: "
    ]
    return common.common_add(table, module_headers)
Example #6
0
def add(table):
    module_headers = ["Title: ", "Manufacturer: ", "Price: ", "In stock: "]
    return common.common_add(table, module_headers)
Example #7
0
def add(table):
    module_headers = ["Name: ", "Birth date: "]
    return common.common_add(table, module_headers)
Example #8
0
def add(table):
    module_headers = ["Name: ", "E-mail: ", "Subscribed: "]
    return common.common_add(table, module_headers)
def add(table):
    module_headers = ["Title: ", "Price: ", "Month: ", "Day: ", "Year: ", "Customer ID: "]
    return common.common_add(table, module_headers)