예제 #1
0
    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]
예제 #2
0
 def __init__(self, *args, **kwargs):
     BaseFormView.__init__(self, *args, **kwargs)
     self.form_config = UserFormConfigState(self.session)
예제 #3
0
 def __init__(self, *args, **kwargs):
     BaseFormView.__init__(self, *args, **kwargs)
     ensure_doctypes_rel(self.current_userdatas.id, self.request)
예제 #4
0
파일: login.py 프로젝트: Swannbm/autonomie
 def __init__(self, *args, **kwargs):
     BaseFormView.__init__(self, *args, **kwargs)
     self.form_config = UserFormConfigState(self.session)
예제 #5
0
 def __init__(self, *args, **kwargs):
     BaseFormView.__init__(self, *args, **kwargs)
     ensure_doctypes_rel(self.current_userdatas.id, self.request)