'Import CSV file into database
@param file: file handle
@param table: the table to import to'

def import_csv(self, file, table=None):

    if table:
        table.import_from_csv_file(file)
    else:
        db = current.db
        db.import_from_csv_file(file)
        db.commit()
