rattail.batch.pricing

Handler for pricing batches

class rattail.batch.pricing.PricingBatchHandler(config, **kwargs)[source]

Handler for pricing batches.

allow_future()[source]

Returns boolean indicating whether “future” price changes should be allowed.

Returns:

True if future price changes allowed; else False.

batch_model_class

alias of PricingBatch

find_products_with_srp_breach(session, progress=None)[source]

Find and return a list of all products whose “regular price” is greater than “suggested price” (SRP).

populate(batch, progress=None)[source]

Batch row data comes from product query.

populate_from_file(batch, progress=None)[source]

Batch row data comes from input data file.

populate_from_product_batch(batch, progress=None)[source]

Populate pricing batch from product batch.

populate_from_query(batch, progress=None)[source]

Batch row data comes from product query, which should be available via the batch.products attribute.

refresh_row(row)[source]

Inspect a row from the source data and populate additional attributes for it, according to what we find in the database.

set_status_per_diff(row)[source]

Set the row’s status code according to its price diff

should_populate(batch)[source]

Must return a boolean indicating whether the given batch should be populated from an initial data source, i.e. at time of batch creation. Override this method if you need to inspect the batch in order to determine whether the populate step is needed. Default behavior is to simply return the value of populate_batches.