def update(table, id_): """ Updates specified record in the table. Ask users for new data. Args: table (list): list in which record should be updated id_ (str): id of a record to update Returns: list: table with updated record """ # your code ui_title = "Sales item update" ui_options = ["Title", "Price", "Month", "Day", "Year", "Customer_id"] ui_exit_message = "Back to Sales menu" list_labels = [ "Please enter title: ", "Please enter price:", "Please enter month: ", "Please enter day: ", "Please enter year: ", "Please enter customer_id" ] types = ['str_int', 'int', 'month', 'day', 'year', 'str_int'] table = common.update_function_common(table, id_, ui_title, ui_options, ui_exit_message, list_labels, types) customer_table = data_manager.get_table_from_file("crm/customers.csv") id_index = 0 for i in range(len(table)): if id_[0] == table[i][0]: id_index = i for j in range(len(customer_table)): if table[id_index][6] == customer_table[j][0]: table[id_index][7] = customer_table[j][1] return table
def update(table, id_): """ Updates specified record in the table. Ask users for new data. Args: table: list in which record should be updated id_ (str): id of a record to update Returns: list: table with updated record """ # your code ui_options = ['Title', 'Manufacturer', 'Price', 'In stock'] ui_title = "Store item update" ui_exit_message = "Back to Store menu" list_labels = ['Please enter title:', 'Please enter the manufacturer:', 'Please enter price:', 'Please enter in stock:'] types = ['str_int', 'str_int', 'int', 'int'] table = common.update_function_common(table, id_, ui_title, ui_options, ui_exit_message, list_labels, types) return table
def update(table, id_): """ Updates specified record in the table. Ask users for new data. Args: table (list): list in which record should be updated id_ (str): id of a record to update Returns: list: table with updated record """ # your code ui_options = ["Name", "Birth Year"] ui_title = "HR item update" ui_exit_message = "Back to HR menu" list_labels = ['Please enter name: ', 'Please enter birth year:'] types = ['str', 'year'] table = common.update_function_common(table, id_, ui_title, ui_options, ui_exit_message, list_labels, types) return table
def update(table, id_): """ Updates specified record in the table. Ask users for new data. Args: table (list): list in which record should be updated id_ (str): id of a record to update Returns: list: table with updated record """ # your code ui_options = ['Month', 'Day', 'Year', 'Type', 'Amount'] ui_title = "Accounting item update" ui_exit_message = "Back to Accounting menu" list_labels = [ 'Please enter month: ', 'Please enter day: ', 'Please enter year: ', 'Please enter type: ', 'Please enter amount: ' ] table = common.update_function_common(table, id_, ui_title, ui_options, ui_exit_message, list_labels) return table
def update(table, id_): """ Updates specified record in the table. Ask users for new data. Args: table (list): list in which record should be updated id_ (str): id of a record to update Returns: list: table with updated record """ # your code ui_options = ['Name', 'Email', 'Subscribed'] ui_title = "CRM item update" ui_exit_message = "Back to CRM menu" list_labels = [ 'Please enter name: ', 'Please enter email: ', 'Please enter subscribed: ' ] table = common.update_function_common(table, id_, ui_title, ui_options, ui_exit_message, list_labels) return table
def update(table, id_): """ Updates specified record in the table. Ask users for new data. Args: table (list): list in which record should be updated id_ (str): id of a record to update Returns: list: table with updated record """ # your code ui_options = ['Name', 'Manufacturer', 'Purchase year', 'Durability'] ui_title = "Inventory item update" ui_exit_message = "Back to Inventory menu" list_labels = [ "Please enter a name: ", "Please enter the manufacturer:", "Please enter purchase year: ", "Please enter durability: " ] types = ['str_int', 'str_int', 'year', 'int'] table = common.update_function_common(table, id_, ui_title, ui_options, ui_exit_message, list_labels, types) return table