wuttasync.importing.wutta¶
Wutta → Wutta import/export
- class wuttasync.importing.wutta.FromWuttaMirror(config, **kwargs)[source]¶
Base class for Wutta → Wutta data importers/exporters.
This inherits from
FromSqlalchemyMirror.
- class wuttasync.importing.wutta.FromWuttaToWuttaBase(config, **kwargs)[source]¶
Base class for Wutta → Wutta data import/export handlers.
This inherits from
FromWuttaHandlerandToWuttaHandler.- dbkey = None¶
Config key for the “other” (non-local) app database. Depending on context this will represent either the source or target for import/export.
- define_importers()[source]¶
This overrides typical (manual) importer definition, and instead dynamically generates a set of importers, e.g. one per table in the target DB.
It does this by calling
make_importer_factory()for each class found in the app model.
- make_importer_factory(model_class, name)[source]¶
Generate and return a new importer class, targeting the given data model class.
The newly-created class will inherit from:
- Parameters:
model_class – A data model class.
name – The “model name” for the importer/exporter. New class name will be based on this, so e.g.
Widgetmodel name becomesWidgetImporterclass name.
- Returns:
The new class, meant to process import/export targeting the given data model.
- class wuttasync.importing.wutta.FromWuttaToWuttaExport(config, **kwargs)[source]¶
Handler for Wutta (local) → Wutta (other) data export.
This inherits from
FromWuttaToWuttaBase.- make_target_session()[source]¶
This makes a “normal” db session, but will use the engine corresponding to the
dbkey.
- orientation = 'export'¶
- class wuttasync.importing.wutta.FromWuttaToWuttaImport(config, **kwargs)[source]¶
Handler for Wutta (other) → Wutta (local) data import.
This inherits from
FromWuttaToWuttaBase.- make_source_session()[source]¶
This makes a “normal” db session, but will use the engine corresponding to the
dbkey.
- orientation = 'import'¶