def update(file, common_options): get_table_from(file) id_ = terminal_view.get_input("ID: ", "Please provide ID, which you want to edit") record = terminal_view.get_inputs([opt for opt in common_options], "Please provide following data: ") save(file, common.update(get_table_from(file), id_, record))
def update_record(table, id, inputs, filename): counter = 0 update_id = None for item in table: if str(item[0]) in str(id): update_id = counter new_list = common.update(table, update_id, make_record(get_data(), inputs)) counter += 1 data_manager.write_table_to_file(filename, new_list)
def update(table, id_, record): """ Updates specified record in the table. Args: table: list in which record should be updated id_ (str): id of a record to update record (list): updated record Returns: list: table with updated record """ table = common.update(table, id_, record) return table
def update(table, id_, record): """ Updates specified record in the table. Args: table: list in which record should be updated id_ (str): id of a record to update record (list): updated record Returns: list: table with updated record """ # record[3], record[1], record[2] = int(record[3]), int(record[1]), int(record[2]) table = common.update(table, id_, record) # your code return table
def update(table, id_, record): table = common.update(table, id_, record) return table