'"company","name of the company", "True", "required", "TextField",,
"due date","turnaround time", "True", "optional", "SelectField","24 hours, 1 week, 1 month"'

def __import_fields(self, trans, csv_file, form_type):

    import csv
    fields = []
    layouts = set()
    try:
        reader = csv.reader(csv_file.file)
        index = 1
        for row in reader:
            if (len(row) < 7):
                continue
            options = row[5].split(',')
            if (len(row) >= 8):
                fields.append({'name': ('%i_field_name' % index), 'label': row[0], 'helptext': row[1], 'visible': row[2], 'required': row[3], 'type': row[4], 'selectlist': options, 'layout': row[6], 'default': row[7]})
                layouts.add(row[6])
            else:
                fields.append({'name': ('%i_field_name' % index), 'label': row[0], 'helptext': row[1], 'visible': row[2], 'required': row[3], 'type': row[4], 'selectlist': options, 'default': row[6]})
            index = (index + 1)
    except:
        return trans.response.send_redirect(web.url_for(controller='forms', action='create_form', status='error', message=('Error    in    importing    <b>%s</b>    file' % csv_file.file)))
    self.__imported_from_file = True
    return (fields, list(layouts))
