Repetition of data for import_from_csv_file() in web2py for sqlite database table
问题 I want to load data from csv file into SQlite database. My code is : Model: db.define_table('data_table', Field('Title',requires =IS_NOT_EMPTY()), Field('Link',requires =IS_NOT_EMPTY())) db.data_table.import_from_csv_file(open('mycsv'),'rb') Controller: def index(): query=((db.data_table.id)) fields = (db.data_table.id, db.data_table.Title, db.data_table.Link) headers = {'data_table.id': 'ID', 'db.data_table.Title': 'Title', 'db.data_table.Link': 'Link', } default_sort_order=[db.data_table.id