def __init__(self, context, request): BaseFormView.__init__(self, request) self.model_type = self.request.GET['model_type'] self.quotechar = self.request.GET['quotechar'] self.delimiter = self.request.GET['delimiter'] if self.model_type not in self.model_types: raise HTTPForbidden() # We first count the number of elements in the file self.filepath = get_current_csv_filepath(self.request) # We build a field - model attr associator self.associator = get_csv_import_associator(self.model_type) _csv_obj = get_current_csv(self.filepath, self.delimiter, self.quotechar) self.headers = [header for header in _csv_obj.fieldnames if header]
def __init__(self, *args, **kwargs): BaseFormView.__init__(self, *args, **kwargs) self.form_config = UserFormConfigState(self.session)
def __init__(self, *args, **kwargs): BaseFormView.__init__(self, *args, **kwargs) ensure_doctypes_rel(self.current_userdatas.id, self.request)