Manager class reference¶
SimpleManager
¶
BaseManager
¶
-
class
data_migrator.models.manager.
BaseManager
(*args, **kwargs)[source]¶ BaseManager is the foundation for all managers, contains to base logic to maintain models: parse, keep and emit.
Extend this class for actual managers
-
scan_row
(row, previous=None)[source]¶ scan one row and save to list
Parameters: - row – current row to scan
- previous (list) – list of list of previous objects in this scan
Returns: list of saved objects
-
transform
(row, previous, model)[source]¶ defines the instantiation of objects from a row
Override this function in your own manager. Models are ordered and generated records are offered in the consequtives managers too.
Parameters: - row (list) – all input data for a new row
- previous (list) – all generated objects from previous managers in chain
- model (Model) – Model this manager is linked to
Returns: list of all generated objects
-