rattail.importing.rattail

Rattail -> Rattail data import

class rattail.importing.rattail.FromRattailHandler(config=None, **kwargs)[source]

Base class for import handlers which target a Rattail database on the local side.

make_host_session()[source]

Subclasses must override this to define the host database connection.

class rattail.importing.rattail.ToRattailHandler(config=None, **kwargs)[source]

Base class for import handlers which target a Rattail database on the local side.

make_session()[source]

Subclasses must override this to define the local database connection.

class rattail.importing.rattail.FromRattailToRattailImport(config=None, **kwargs)[source]

Handler for Rattail (other) -> Rattail (local) data import.

direction

Value is 'import' - see also rattail.importing.handlers.ImportHandler.direction.

make_host_session()[source]

Subclasses must override this to define the host database connection.

class rattail.importing.rattail.FromRattailToRattailExport(config=None, **kwargs)[source]

Handler for Rattail (local) -> Rattail (other) data export.

direction

Value is 'export' - see also rattail.importing.handlers.ImportHandler.direction.

make_session()[source]

Subclasses must override this to define the local database connection.

class rattail.importing.rattail.RoleImporter(config=None, key=None, direction='import', fields=None, exclude_fields=None, fuzzy_fields=None, fuzz_factor=None, **kwargs)[source]
class rattail.importing.rattail.GlobalRoleImporter(config=None, key=None, direction='import', fields=None, exclude_fields=None, fuzzy_fields=None, fuzz_factor=None, **kwargs)[source]

Role importer which only will handle roles which have the sync_me flag set. (So it syncs those roles but avoids others.)

cache_query()[source]

Return the query to be used when caching “local” data.

normalize_local_object(role)[source]

Normalize a local (raw) object into a data dict.

query()[source]

Leverage the same caching optimizations on both sides, if applicable.

property supported_fields

We only need to support the simple fields, since all relevant tables should be covered and therefore no need to do crazy foreign key acrobatics etc.

update_object(role, host_data, local_data=None, **kwargs)[source]

Update the local data object with the given host data, and return the object.