shuup.admin.modules.orders.views package

Submodules

shuup.admin.modules.orders.views.addresses module

class shuup.admin.modules.orders.views.addresses.OrderAddressEditView(**kwargs)[source]

Bases: django.views.generic.edit.UpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

model

alias of Order

context_object_name = 'order'
template_name = 'shuup/admin/orders/_address_edit.jinja'
get_form(form_class=None)[source]
form_valid(form)[source]
get_form_kwargs()[source]
get_context_data(**kwargs)[source]

shuup.admin.modules.orders.views.detail module

class shuup.admin.modules.orders.views.detail.OrderDetailView(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

model

alias of Order

template_name = 'shuup/admin/orders/detail.jinja'
context_object_name = 'order'
get_toolbar()[source]
get_context_data(**kwargs)[source]
class shuup.admin.modules.orders.views.detail.OrderSetStatusView(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

model

alias of Order

get(request, *args, **kwargs)[source]
post(request, *args, **kwargs)[source]

shuup.admin.modules.orders.views.edit module

shuup.admin.modules.orders.views.edit.create_order_from_state(state, **kwargs)[source]
shuup.admin.modules.orders.views.edit.update_order_from_state(state, order_to_update, **kwargs)[source]
shuup.admin.modules.orders.views.edit.create_source_from_state(state, **kwargs)[source]
shuup.admin.modules.orders.views.edit.encode_address(address, tax_number='')[source]
shuup.admin.modules.orders.views.edit.encode_shop(shop)[source]
shuup.admin.modules.orders.views.edit.encode_method(method)[source]
shuup.admin.modules.orders.views.edit.encode_line(line)[source]
shuup.admin.modules.orders.views.edit.get_line_data_for_edit(shop, line)[source]
shuup.admin.modules.orders.views.edit.get_price_info(shop, customer, product, quantity)[source]

Get price info of given product for given context parameters.

class shuup.admin.modules.orders.views.edit.OrderEditView(**kwargs)[source]

Bases: shuup.admin.utils.views.CreateOrUpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

model

alias of Order

template_name = 'shuup/admin/orders/create.jinja'
context_object_name = 'order'
title = 'Create Order'
fields = []
get_context_data(**kwargs)[source]
get_toolbar()[source]
get_config()[source]
get_initial_order_data()[source]
get_customer_data(customer_id)[source]
dispatch(request, *args, **kwargs)[source]
dispatch_command(request)[source]
handle_product_data(request)[source]
handle_customer_data(request)[source]
handle_customer_exists(request)[source]
handle_customer_details(request)[source]
handle_source_data(request)[source]
handle_finalize(request)[source]
class shuup.admin.modules.orders.views.edit.UpdateAdminCommentView(**kwargs)[source]

Bases: django.views.generic.base.View

Update order’s admin comment

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

post(request, *args, **kwargs)[source]

shuup.admin.modules.orders.views.list module

class shuup.admin.modules.orders.views.list.OrderStatusChoicesFilter(choices=None, filter_field=None, default=None)[source]

Bases: shuup.admin.utils.picotable.ChoicesFilter

Custom choices filter for order statuses

Sets filter default choice to initial order status if status exists. Default order status can not be passed for init since it would cause database queries and in all cases the order status table might not even be in the database when init is called.

default
class shuup.admin.modules.orders.views.list.OrderListView[source]

Bases: shuup.admin.utils.views.PicotableListView

model

alias of Order

default_columns = [<Column: Order> identifier, <Column: Order Date> order_date, <Column: Customer> customer, <Column: Status> status, <Column: Payment Status> payment_status, <Column: Shipping Status> shipping_status, <Column: Total> taxful_total_price_value]
mass_actions = ['shuup.admin.modules.orders.mass_actions:CancelOrderAction', 'shuup.admin.modules.orders.mass_actions:OrderConfirmationPdfAction', 'shuup.admin.modules.orders.mass_actions:OrderDeliveryPdfAction']
get_queryset()[source]
format_customer_name(instance, *args, **kwargs)[source]
format_order_date(instance, *args, **kwargs)[source]
format_taxful_total_price(instance, *args, **kwargs)[source]
get_object_abstract(instance, item)[source]

shuup.admin.modules.orders.views.log module

class shuup.admin.modules.orders.views.log.NewLogEntryView(**kwargs)[source]

Bases: django.views.generic.base.View

Create a log note item associated with a particular order.

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

post(request, *args, **kwargs)[source]

shuup.admin.modules.orders.views.payment module

class shuup.admin.modules.orders.views.payment.OrderCreatePaymentView(**kwargs)[source]

Bases: django.views.generic.edit.UpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

model

alias of Order

template_name = 'shuup/admin/orders/create_payment.jinja'
context_object_name = 'order'
form_class

alias of Form

get_context_data(**kwargs)[source]
get_form_kwargs()[source]
get_form(form_class=None)
form_invalid(form)[source]
form_valid(form)[source]
class shuup.admin.modules.orders.views.payment.OrderSetPaidView(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

model

alias of Order

get(request, *args, **kwargs)[source]
post(request, *args, **kwargs)[source]

shuup.admin.modules.orders.views.refund module

class shuup.admin.modules.orders.views.refund.RefundForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False)[source]

Bases: django.forms.forms.Form

clean_line_number()[source]
clean_quantity()[source]
clean_amount()[source]
base_fields = OrderedDict([('line_number', <django.forms.fields.ChoiceField object at 0x7fabcd629ac8>), ('quantity', <django.forms.fields.DecimalField object at 0x7fabcd62beb8>), ('text', <django.forms.fields.CharField object at 0x7fabcd62b0f0>), ('amount', <django.forms.fields.DecimalField object at 0x7fabcd62bd30>), ('restock_products', <django.forms.fields.BooleanField object at 0x7fabcd8ec160>)])
declared_fields = OrderedDict([('line_number', <django.forms.fields.ChoiceField object at 0x7fabcd629ac8>), ('quantity', <django.forms.fields.DecimalField object at 0x7fabcd62beb8>), ('text', <django.forms.fields.CharField object at 0x7fabcd62b0f0>), ('amount', <django.forms.fields.DecimalField object at 0x7fabcd62bd30>), ('restock_products', <django.forms.fields.BooleanField object at 0x7fabcd8ec160>)])
media
class shuup.admin.modules.orders.views.refund.OrderCreateRefundView(**kwargs)[source]

Bases: django.views.generic.edit.UpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

model

alias of Order

template_name = 'shuup/admin/orders/create_refund.jinja'
context_object_name = 'order'
form_class

alias of RefundFormFormSet

get_context_data(**kwargs)[source]
get_form_kwargs()[source]
get_form(form_class=None)
form_valid(form)[source]
class shuup.admin.modules.orders.views.refund.FullRefundConfirmationForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False)[source]

Bases: django.forms.forms.Form

base_fields = OrderedDict([('restock_products', <django.forms.fields.BooleanField object at 0x7fabcd2b4630>)])
declared_fields = OrderedDict([('restock_products', <django.forms.fields.BooleanField object at 0x7fabcd2b4630>)])
media
class shuup.admin.modules.orders.views.refund.OrderCreateFullRefundView(**kwargs)[source]

Bases: django.views.generic.edit.UpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

model

alias of Order

template_name = 'shuup/admin/orders/create_full_refund.jinja'
context_object_name = 'order'
form_class

alias of FullRefundConfirmationForm

get_context_data(**kwargs)[source]
get_form_kwargs()[source]
form_valid(form)[source]

shuup.admin.modules.orders.views.shipment module

class shuup.admin.modules.orders.views.shipment.ShipmentForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False)[source]

Bases: shuup.admin.form_modifier.ModifiableFormMixin, django.forms.forms.Form

form_modifier_provide_key = 'admin_extend_create_shipment_form'
base_fields = OrderedDict([('description', <django.forms.fields.CharField object at 0x7fabcd8ec390>), ('tracking_code', <django.forms.fields.CharField object at 0x7fabcd8ec5f8>)])
declared_fields = OrderedDict([('description', <django.forms.fields.CharField object at 0x7fabcd8ec390>), ('tracking_code', <django.forms.fields.CharField object at 0x7fabcd8ec5f8>)])
media
class shuup.admin.modules.orders.views.shipment.OrderCreateShipmentView(**kwargs)[source]

Bases: shuup.admin.form_modifier.ModifiableViewMixin, django.views.generic.edit.UpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

model

alias of Order

template_name = 'shuup/admin/orders/create_shipment.jinja'
context_object_name = 'order'
form_class

alias of ShipmentForm

get_context_data(**kwargs)[source]
get_form_kwargs()[source]
get_form()[source]
form_invalid(form)[source]
create_shipment(order, product_quantities, shipment)[source]

This function exists so subclasses can implement custom logic without overriding the entire form_valid method

Parameters:
  • order (shuup.core.models.Order) – Order to create the shipment for
  • product_quantities (dict[shuup.shop.models.Product, decimal.Decimal]) – a dict mapping Product instances to quantities to ship
  • shipment (shuup.core.models.Shipment) – unsaved Shipment for ShipmentProduct’s.
Returns:

Saved, complete Shipment object

Return type:

shuup.core.models.Shipment

form_valid(form)[source]
class shuup.admin.modules.orders.views.shipment.ShipmentDeleteView(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

model

alias of Shipment

context_object_name = 'shipment'
get(request, *args, **kwargs)[source]
post(request, *args, **kwargs)[source]

shuup.admin.modules.orders.views.status module

class shuup.admin.modules.orders.views.status.OrderStatusForm(**kwargs)[source]

Bases: shuup.utils.multilanguage_model_form.MultiLanguageModelForm

class Meta[source]

Bases: object

model

alias of OrderStatus

exclude = ['default']
OrderStatusForm.clean()[source]
OrderStatusForm.save(commit=True)[source]
OrderStatusForm.base_fields = OrderedDict([('identifier', <django.forms.fields.CharField object at 0x7fabcd5ca3c8>), ('ordering', <django.forms.fields.IntegerField object at 0x7fabcd2d3f98>), ('role', <enumfields.forms.EnumChoiceField object at 0x7fabcd6260f0>), ('is_active', <django.forms.fields.BooleanField object at 0x7fabcd626630>), ('name', <django.forms.fields.CharField object at 0x7fabcd8ec278>), ('public_name', <django.forms.fields.CharField object at 0x7fabcd939160>)])
OrderStatusForm.declared_fields = OrderedDict([('name', <django.forms.fields.CharField object at 0x7fabcd8ec278>), ('public_name', <django.forms.fields.CharField object at 0x7fabcd939160>)])
OrderStatusForm.media
class shuup.admin.modules.orders.views.status.OrderStatusEditView(**kwargs)[source]

Bases: shuup.admin.breadcrumbs._views.BreadcrumbedView, shuup.admin.utils.views.CreateOrUpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

model

alias of OrderStatus

form_class

alias of OrderStatusForm

template_name = 'shuup/admin/orders/status.jinja'
context_object_name = 'status'
parent_name = <django.utils.functional.lazy.<locals>.__proxy__ object>
parent_url = 'shuup_admin:order_status.list'
class shuup.admin.modules.orders.views.status.OrderStatusListView[source]

Bases: shuup.admin.utils.views.PicotableListView

model

alias of OrderStatus

default_columns = [<Column: Identifier> identifier, <Column: Name> name, <Column: Public Name> public_name, <Column: Role> role, <Column: Default> default, <Column: Active> is_active]

Module contents

class shuup.admin.modules.orders.views.NewLogEntryView(**kwargs)[source]

Bases: django.views.generic.base.View

Create a log note item associated with a particular order.

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

post(request, *args, **kwargs)[source]
class shuup.admin.modules.orders.views.OrderAddressEditView(**kwargs)[source]

Bases: django.views.generic.edit.UpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

context_object_name = 'order'
form_valid(form)[source]
get_context_data(**kwargs)[source]
get_form(form_class=None)[source]
get_form_kwargs()[source]
model

alias of Order

template_name = 'shuup/admin/orders/_address_edit.jinja'
class shuup.admin.modules.orders.views.OrderDetailView(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

context_object_name = 'order'
get_context_data(**kwargs)[source]
get_toolbar()[source]
model

alias of Order

template_name = 'shuup/admin/orders/detail.jinja'
class shuup.admin.modules.orders.views.OrderEditView(**kwargs)[source]

Bases: shuup.admin.utils.views.CreateOrUpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

context_object_name = 'order'
dispatch(request, *args, **kwargs)[source]
dispatch_command(request)[source]
fields = []
get_config()[source]
get_context_data(**kwargs)[source]
get_customer_data(customer_id)[source]
get_initial_order_data()[source]
get_toolbar()[source]
handle_customer_data(request)[source]
handle_customer_details(request)[source]
handle_customer_exists(request)[source]
handle_finalize(request)[source]
handle_product_data(request)[source]
handle_source_data(request)[source]
model

alias of Order

template_name = 'shuup/admin/orders/create.jinja'
title = 'Create Order'
class shuup.admin.modules.orders.views.OrderListView[source]

Bases: shuup.admin.utils.views.PicotableListView

default_columns = [<Column: Order> identifier, <Column: Order Date> order_date, <Column: Customer> customer, <Column: Status> status, <Column: Payment Status> payment_status, <Column: Shipping Status> shipping_status, <Column: Total> taxful_total_price_value]
format_customer_name(instance, *args, **kwargs)[source]
format_order_date(instance, *args, **kwargs)[source]
format_taxful_total_price(instance, *args, **kwargs)[source]
get_object_abstract(instance, item)[source]
get_queryset()[source]
mass_actions = ['shuup.admin.modules.orders.mass_actions:CancelOrderAction', 'shuup.admin.modules.orders.mass_actions:OrderConfirmationPdfAction', 'shuup.admin.modules.orders.mass_actions:OrderDeliveryPdfAction']
model

alias of Order

class shuup.admin.modules.orders.views.OrderCreatePaymentView(**kwargs)[source]

Bases: django.views.generic.edit.UpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

context_object_name = 'order'
form_class

alias of Form

form_invalid(form)[source]
form_valid(form)[source]
get_context_data(**kwargs)[source]
get_form(form_class=None)
get_form_kwargs()[source]
model

alias of Order

template_name = 'shuup/admin/orders/create_payment.jinja'
class shuup.admin.modules.orders.views.OrderCreateFullRefundView(**kwargs)[source]

Bases: django.views.generic.edit.UpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

context_object_name = 'order'
form_class

alias of FullRefundConfirmationForm

form_valid(form)[source]
get_context_data(**kwargs)[source]
get_form_kwargs()[source]
model

alias of Order

template_name = 'shuup/admin/orders/create_full_refund.jinja'
class shuup.admin.modules.orders.views.OrderCreateRefundView(**kwargs)[source]

Bases: django.views.generic.edit.UpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

context_object_name = 'order'
form_class

alias of RefundFormFormSet

form_valid(form)[source]
get_context_data(**kwargs)[source]
get_form(form_class=None)
get_form_kwargs()[source]
model

alias of Order

template_name = 'shuup/admin/orders/create_refund.jinja'
class shuup.admin.modules.orders.views.OrderCreateShipmentView(**kwargs)[source]

Bases: shuup.admin.form_modifier.ModifiableViewMixin, django.views.generic.edit.UpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

context_object_name = 'order'
create_shipment(order, product_quantities, shipment)[source]

This function exists so subclasses can implement custom logic without overriding the entire form_valid method

Parameters:
  • order (shuup.core.models.Order) – Order to create the shipment for
  • product_quantities (dict[shuup.shop.models.Product, decimal.Decimal]) – a dict mapping Product instances to quantities to ship
  • shipment (shuup.core.models.Shipment) – unsaved Shipment for ShipmentProduct’s.
Returns:

Saved, complete Shipment object

Return type:

shuup.core.models.Shipment

form_class

alias of ShipmentForm

form_invalid(form)[source]
form_valid(form)[source]
get_context_data(**kwargs)[source]
get_form()[source]
get_form_kwargs()[source]
model

alias of Order

template_name = 'shuup/admin/orders/create_shipment.jinja'
class shuup.admin.modules.orders.views.OrderSetPaidView(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

get(request, *args, **kwargs)[source]
model

alias of Order

post(request, *args, **kwargs)[source]
class shuup.admin.modules.orders.views.OrderSetStatusView(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

get(request, *args, **kwargs)[source]
model

alias of Order

post(request, *args, **kwargs)[source]
class shuup.admin.modules.orders.views.OrderStatusEditView(**kwargs)[source]

Bases: shuup.admin.breadcrumbs._views.BreadcrumbedView, shuup.admin.utils.views.CreateOrUpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

context_object_name = 'status'
form_class

alias of OrderStatusForm

model

alias of OrderStatus

parent_name = <django.utils.functional.lazy.<locals>.__proxy__ object>
parent_url = 'shuup_admin:order_status.list'
template_name = 'shuup/admin/orders/status.jinja'
class shuup.admin.modules.orders.views.OrderStatusListView[source]

Bases: shuup.admin.utils.views.PicotableListView

default_columns = [<Column: Identifier> identifier, <Column: Name> name, <Column: Public Name> public_name, <Column: Role> role, <Column: Default> default, <Column: Active> is_active]
model

alias of OrderStatus

class shuup.admin.modules.orders.views.ShipmentDeleteView(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

context_object_name = 'shipment'
get(request, *args, **kwargs)[source]
model

alias of Shipment

post(request, *args, **kwargs)[source]
class shuup.admin.modules.orders.views.UpdateAdminCommentView(**kwargs)[source]

Bases: django.views.generic.base.View

Update order’s admin comment

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

post(request, *args, **kwargs)[source]