tailbone.api.batch.ordering

Tailbone Web API - Ordering Batches

These views expose the basic CRUD interface to “ordering” batches, for the web API.

class tailbone.api.batch.ordering.OrderingBatchViews(request, **kwargs)[source]
collection_url_prefix = '/ordering-batches'
object_url_prefix = '/ordering-batch'
model_class = <class 'rattail.db.model.batch.purchase.PurchaseBatch'>
route_prefix = 'orderingbatchviews'
permission_prefix = 'ordering'
default_handler_spec = 'rattail.batch.purchase:PurchaseBatchHandler'
base_query()[source]

Modifies the default logic as follows:

Adds a condition to the query, to ensure only purchase batches with “ordering” mode are returned.

create_object(data)[source]

Modifies the default logic as follows:

Sets the mode to “ordering” for the new batch.

class tailbone.api.batch.ordering.OrderingBatchRowViews(request, **kwargs)[source]
collection_url_prefix = '/ordering-batch-rows'
object_url_prefix = '/ordering-batch-row'
model_class = <class 'rattail.db.model.batch.purchase.PurchaseBatchRow'>
route_prefix = 'ordering.rows'
permission_prefix = 'ordering'
default_handler_spec = 'rattail.batch.purchase:PurchaseBatchHandler'
supports_quick_entry = True
update_object(row, data)[source]

Overrides the default logic as follows:

So far, we only allow updating the cases_ordered and/or units_ordered quantities; therefore data should have one or both of those keys.

This data is then passed to the update_row_quantity() method of the batch handler.

Note that the “normal” logic for this method is not invoked at all.