XMLImporter

class data_importer.importers.xml_importer.XMLImporter(source=None, *args, **kwargs)

Import XML files

class Meta

Importer configurations

XMLImporter.clean()

Custom clean method

XMLImporter.clean_field(field_name, value)

User default django field validators to clean content and run custom validates

XMLImporter.clean_row(row_values)

Custom clean method for full row data

XMLImporter.cleaned_data

Return tupla with data cleaned

XMLImporter.errors

Show errors catch by clean methods

XMLImporter.exclude_fields()

Exclude fields from Meta.exclude

XMLImporter.get_error_message(error, row=None, error_type=None)
XMLImporter.is_valid()

Clear content and return False if have errors

XMLImporter.load_descriptor()

Set fields from descriptor file

XMLImporter.meta

Is same to use .Meta

XMLImporter.post_clean()

Excuted after all clean method

XMLImporter.post_save_all_lines()

End exection

XMLImporter.pre_clean()

Executed before all clean methods Important: pre_clean dont have cleaned_data content

XMLImporter.pre_commit()

Executed before commit multiple register

XMLImporter.process_row(row, values)

Read clean functions from importer and return tupla with row number, field and value

XMLImporter.root = 'root'
XMLImporter.save(instance=None)

Save all contents DONT override this method

XMLImporter.set_reader()
XMLImporter.source

Return source opened

XMLImporter.start_fields()

Initial function to find fields or headers values This values will be used to process clean and save method If this method not have fields and have Meta.model this method will use model fields to populate content without id

XMLImporter.to_unicode(bytestr)

Receive string bytestr and try to return a utf-8 string.