Module for managing imports
Returns data from csv file as a list of RowData objects
DataPreviewPage is the previewing page for the import wizard
FinalPage is the final page in the import process
ImportWizard provides a two-step wizard for importing data as objects into Camelot. To create a custom wizard, subclass this ImportWizard and overwrite its class attributes.
To import a different file format, you probably need a custom collection_getter for this file type.
Add all pages to the import wizard, reimplement this method to add custom pages to the wizard. This method is called in the __init__ method, to add all pages to the wizard.
Parameters: | model – the CollectionProxy that will be used to display the to |
---|
be imported data :param admin: the admin of the destination data
alias of CsvCollectionGetter
alias of DataPreviewPage
alias of RowDataAdminDecorator
alias of SelectFilePage
Class representing the data in a single row of the imported file as an object with attributes column_1, column_2, ..., each representing the data in a single column of that row.
since the imported file might contain less columns than expected, the RowData object returns None for not existing attributes
Decorator that transforms the Admin of the class to be imported to an Admin of the RowData objects to be used when previewing and validating the data to be imported.
based on the field attributes of the original mode, it will turn the background color pink if the data is invalid for being imported.
Iterator that reads an encoded stream and reencodes the input to UTF-8.