rattail.importing.model

Rattail Model Importers

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

User data importer, plus ‘admin’ boolean field.

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

normalize_local_object(user)[source]

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

setup()[source]

Perform any setup necessary, e.g. cache lookups for existing data.

property supported_fields

All/only simple fields are supported by default.

update_object(user, data, local_data=None)[source]

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

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

Brand data importer.

model_class

alias of Brand

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

Category data importer.

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

model_class

alias of Category

normalize_local_object(category)[source]

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

setup()[source]

Perform any setup necessary, e.g. cache lookups for existing data.

property supported_fields

All/only simple fields are supported by default.

update_object(category, data, local_data=None)[source]

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

class rattail.importing.model.ContactMixin[source]

Mixin for importers which target a “contact” sort of record, e.g. customers.

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

Customer email address data importer.

model_class

alias of CustomerEmailAddress

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

CustomerGroupAssignment data importer.

model_class

alias of CustomerGroupAssignment

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

CustomerGroup data importer.

model_class

alias of CustomerGroup

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

Customer data importer.

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

datasync_setup()[source]

Perform any setup necessary, in the context of a datasync job.

model_class

alias of Customer

normalize_local_object(customer)[source]

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

setup()[source]

Perform any setup necessary, e.g. cache lookups for existing data.

property supported_fields

All/only simple fields are supported by default.

update_object(customer, data, local_data=None)[source]

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

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

Importer for CustomerOrder data

model_class

alias of CustomerOrder

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

Importer for CustomerOrderItemEvent data

cache_query()[source]

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

model_class

alias of CustomerOrderItemEvent

setup()[source]

Perform any setup necessary, e.g. cache lookups for existing data.

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

Importer for CustomerOrderItem data

model_class

alias of CustomerOrderItem

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

CustomerPerson data importer.

model_class

alias of CustomerPerson

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

Customer phone number data importer.

model_class

alias of CustomerPhoneNumber

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

Customer shopper data importer.

model_class

alias of CustomerShopperHistory

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

Customer shopper data importer.

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

model_class

alias of CustomerShopper

normalize_local_object(shopper)[source]

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

property supported_fields

All/only simple fields are supported by default.

update_object(shopper, data, local_data=None)[source]

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

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

Department data importer.

cache_query()[source]

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

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

model_class

alias of Department

normalize_local_object(department)[source]

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

setup()[source]

Perform any setup necessary, e.g. cache lookups for existing data.

property supported_fields

All/only simple fields are supported by default.

update_object(department, data, local_data=None)[source]

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

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

Deposit link data importer.

model_class

alias of DepositLink

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

Employee/department data importer.

model_class

alias of EmployeeDepartment

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

Employee email data importer.

model_class

alias of EmployeeEmailAddress

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

Employee history data importer

model_class

alias of EmployeeHistory

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

Employee data importer.

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

model_class

alias of Employee

normalize_local_object(employee)[source]

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

setup()[source]

Perform any setup necessary, e.g. cache lookups for existing data.

property supported_fields

All/only simple fields are supported by default.

update_object(employee, data, local_data=None)[source]

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

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

Employee phone data importer.

model_class

alias of EmployeePhoneNumber

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

Employee/store data importer.

model_class

alias of EmployeeStore

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

Family data importer.

model_class

alias of Family

class rattail.importing.model.GlobalMixin[source]

Mixin for importers which should avoid “local only” records.

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

This is a customized version of the PersonImporter, which simply avoids “local only” person accounts.

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

This is a customized version of the UserImporter, which simply avoids “local only” user accounts.

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

IFPS PLU data importer.

model_class

alias of IFPS_PLU

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

InventoryAdjustmentReason data importer.

model_class

alias of InventoryAdjustmentReason

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

Importer for LabelProfile data

cache_query()[source]

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

model_class

alias of LabelProfile

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

Member email address data importer.

model_class

alias of MemberEmailAddress

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

Member equity payment data importer.

model_class

alias of MemberEquityPayment

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

Member data importer.

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

model_class

alias of Member

normalize_local_object(member)[source]

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

setup()[source]

Perform any setup necessary, e.g. cache lookups for existing data.

property supported_fields

All/only simple fields are supported by default.

update_object(member, data, local_data=None)[source]

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

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

Member mailing address data importer.

model_class

alias of MemberMailingAddress

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

Member phone number data importer.

model_class

alias of MemberPhoneNumber

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

Membership type data importer.

model_class

alias of MembershipType

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

Importer for MergePeopleRequest

model_class

alias of MergePeopleRequest

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

User message data importer.

model_class

alias of Message

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

User message recipient data importer.

model_class

alias of MessageRecipient

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

Person email address data importer.

model_class

alias of PersonEmailAddress

normalize_local_object(email)[source]

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

property supported_fields

All/only simple fields are supported by default.

update_object(email, data, local_data=None)[source]

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

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

Person data importer.

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

model_class

alias of Person

normalize_local_object(person)[source]

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

setup()[source]

Perform any setup necessary, e.g. cache lookups for existing data.

property supported_fields

All/only simple fields are supported by default.

update_object(person, data, local_data=None)[source]

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

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

Person mailing address data importer.

model_class

alias of PersonMailingAddress

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

Person notes data importer.

model_class

alias of PersonNote

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

Person phone number data importer.

model_class

alias of PersonPhoneNumber

normalize_local_object(phone)[source]

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

property supported_fields

All/only simple fields are supported by default.

update_object(phone, data, local_data=None)[source]

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

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

Data importer for rattail.db.model.ProductCode.

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

get_single_local_object(key)[source]

Fetch a single ProductCode object from local Rattail, taking complex key fields (namely product_upc) into account.

model_class

alias of ProductCode

new_object(key)[source]

Return a new local object to correspond to the given key. Note that this method should only populate the object’s key, and leave the rest of the fields to update_object().

normalize_local_object(code)[source]

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

setup()[source]

Perform any setup necessary, e.g. cache lookups for existing data.

property supported_fields

All/only simple fields are supported by default.

update_object(code, data, local_data=None)[source]

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

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

Data importer for rattail.db.model.ProductCost.

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

get_single_local_object(key)[source]

Fetch a single ProductCost object from local Rattail, taking complex key fields (e.g. product_upc, vendor_id) into account.

model_class

alias of ProductCost

normalize_local_object(cost)[source]

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

setup()[source]

Perform any setup necessary, e.g. cache lookups for existing data.

property supported_fields

All/only simple fields are supported by default.

update_object(cost, data, local_data=None)[source]

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

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

Importer for product images data. Note that this uses the “batch” approach because fetching all data up front is not performant when the host/local systems are on different machines etc.

model_class

alias of ProductImage

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

Data importer for rattail.db.model.Product.

cache_query()[source]

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

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

datasync_setup()[source]

Perform any setup necessary, in the context of a datasync job.

model_class

alias of Product

normalize_local_object(product)[source]

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

setup()[source]

Perform any setup necessary, e.g. cache lookups for existing data.

property supported_fields

All/only simple fields are supported by default.

update_object(product, data, local_data=None)[source]

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

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

Data importer for rattail.db.model.ProductPrice.

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

model_class

alias of ProductPrice

normalize_local_object(price)[source]

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

property supported_fields

All/only simple fields are supported by default.

update_object(price, data, local_data=None)[source]

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

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

Data importer for rattail.db.model.ProductStoreInfo.

model_class

alias of ProductStoreInfo

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

Data importer for ProductVolatile.

model_class

alias of ProductVolatile

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

ReportCode data importer.

model_class

alias of ReportCode

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

Role data importer.

model_class

alias of Role

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

Imports employee scheduled shifts.

model_class

alias of ScheduledShift

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

Store data importer.

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

model_class

alias of Store

normalize_local_object(store)[source]

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

property supported_fields

All/only simple fields are supported by default.

update_object(store, data, local_data=None)[source]

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

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

Store phone data importer.

model_class

alias of StorePhoneNumber

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

Subdepartment data importer.

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

model_class

alias of Subdepartment

normalize_local_object(subdepartment)[source]

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

setup()[source]

Perform any setup necessary, e.g. cache lookups for existing data.

property supported_fields

All/only simple fields are supported by default.

update_object(subdepartment, data, local_data=None)[source]

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

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

Tax data importer.

model_class

alias of Tax

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

Tender data importer

model_class

alias of Tender

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

Base class for all Rattail model importers.

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

collect_extensions()[source]

Collect all extensions defined within the class hierarchy.

normalize_local_object(obj)[source]

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

setup()[source]

Perform any setup necessary, e.g. cache lookups for existing data.

property simple_fields

Returns the list of column names on the underlying local model mapper.

update_object(obj, host_data, local_data=None)[source]

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

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

User data importer.

delete_object(user)[source]

Override this to invoke the auth handler for user deletion, since it may have extra smarts.

model_class

alias of User

normalize_local_object(user)[source]

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

property supported_fields

All/only simple fields are supported by default.

update_object(user, data, local_data=None)[source]

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

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

Vendor contact data importer.

model_class

alias of VendorContact

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

Vendor email data importer.

model_class

alias of VendorEmailAddress

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

Vendor data importer.

cache_query()[source]

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

cache_query_options()[source]

Return a list of options to apply to the cache query, if needed.

model_class

alias of Vendor

normalize_local_object(vendor)[source]

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

property supported_fields

All/only simple fields are supported by default.

update_object(vendor, data, local_data=None)[source]

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

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

Vendor phone data importer.

model_class

alias of VendorPhoneNumber

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

Vendor sample file importer.

model_class

alias of VendorSampleFile

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

Imports shifts worked by employees.

model_class

alias of WorkedShift