shoop.front.checkout package

Submodules

shoop.front.checkout.addresses module

class shoop.front.checkout.addresses.AddressForm(**kwargs)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

model

alias of MutableAddress

fields = ('name', 'phone', 'email', 'street', 'street2', 'postal_code', 'city', 'region', 'country')
AddressForm.base_fields = OrderedDict([('name', <django.forms.fields.CharField object at 0x7f5300f15e10>), ('phone', <django.forms.fields.CharField object at 0x7f52ff647eb8>), ('email', <django.forms.fields.EmailField object at 0x7f5300ecd5f8>), ('street', <django.forms.fields.CharField object at 0x7f5300ecb2b0>), ('street2', <django.forms.fields.CharField object at 0x7f52ff72e5c0>), ('postal_code', <django.forms.fields.CharField object at 0x7f52ff18a240>), ('city', <django.forms.fields.CharField object at 0x7f52ffbabba8>), ('region', <django.forms.fields.CharField object at 0x7f5300e815f8>), ('country', <django_countries.fields.LazyTypedChoiceField object at 0x7f52ff4787f0>)])
AddressForm.declared_fields = OrderedDict()
AddressForm.media
class shoop.front.checkout.addresses.CompanyForm(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, instance=None)[source]

Bases: shoop.front.checkout._mixins.TaxNumberCleanMixin, django.forms.models.ModelForm

company_name_field = 'name'
class Meta[source]

Bases: object

model

alias of CompanyContact

fields = ('name', 'tax_number')
CompanyForm.base_fields = OrderedDict([('name', <django.forms.fields.CharField object at 0x7f52ff62fda0>), ('tax_number', <django.forms.fields.CharField object at 0x7f5300ef2828>)])
CompanyForm.declared_fields = OrderedDict()
CompanyForm.media
class shoop.front.checkout.addresses.AddressesPhase(**kwargs)[source]

Bases: shoop.front.checkout.CheckoutPhaseViewMixin, django.views.generic.edit.FormView

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

identifier = 'addresses'
title = <django.utils.functional.lazy.<locals>.__proxy__ object>
template_name = 'shoop/front/checkout/addresses.jinja'
address_kinds = ('shipping', 'billing')
address_form_class

alias of AddressForm

address_form_classes = {}
company_form_class

alias of CompanyForm

get_form(form_class=None)
get_initial()[source]
is_valid()[source]
form_valid(form)[source]
process()[source]

shoop.front.checkout.confirm module

class shoop.front.checkout.confirm.ConfirmForm(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([('accept_terms', <django.forms.fields.BooleanField object at 0x7f5300ee01d0>), ('marketing', <django.forms.fields.BooleanField object at 0x7f5300ee08d0>), ('comment', <django.forms.fields.CharField object at 0x7f52ff0c1a20>)])
declared_fields = OrderedDict([('accept_terms', <django.forms.fields.BooleanField object at 0x7f5300ee01d0>), ('marketing', <django.forms.fields.BooleanField object at 0x7f5300ee08d0>), ('comment', <django.forms.fields.CharField object at 0x7f52ff0c1a20>)])
media
class shoop.front.checkout.confirm.ConfirmPhase(**kwargs)[source]

Bases: shoop.front.checkout.CheckoutPhaseViewMixin, django.views.generic.edit.FormView

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

identifier = 'confirm'
title = <django.utils.functional.lazy.<locals>.__proxy__ object>
template_name = 'shoop/front/checkout/confirm.jinja'
form_class

alias of ConfirmForm

process()[source]
is_valid()[source]
get_context_data(**kwargs)[source]
form_valid(form)[source]
create_order()[source]

shoop.front.checkout.empty module

class shoop.front.checkout.empty.EmptyPhase(**kwargs)[source]

Bases: shoop.front.checkout.CheckoutPhaseViewMixin, django.views.generic.base.TemplateView

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

identifier = 'empty'
title = <django.utils.functional.lazy.<locals>.__proxy__ object>
template_name = 'shoop/front/checkout/empty.jinja'
process()[source]

shoop.front.checkout.methods module

class shoop.front.checkout.methods.MethodWidget(attrs=None, choices=())[source]

Bases: django.forms.widgets.Widget

render(name, value, attrs=None)[source]
media
class shoop.front.checkout.methods.MethodChoiceIterator(field)[source]

Bases: django.forms.models.ModelChoiceIterator

choice(obj)[source]
class shoop.front.checkout.methods.MethodsForm(*args, **kwargs)[source]

Bases: django.forms.forms.Form

limit_method_fields()[source]
base_fields = OrderedDict([('shipping_method', <django.forms.models.ModelChoiceField object at 0x7f530066bc50>), ('payment_method', <django.forms.models.ModelChoiceField object at 0x7f5300589a90>)])
declared_fields = OrderedDict([('shipping_method', <django.forms.models.ModelChoiceField object at 0x7f530066bc50>), ('payment_method', <django.forms.models.ModelChoiceField object at 0x7f5300589a90>)])
media
class shoop.front.checkout.methods.MethodsPhase(**kwargs)[source]

Bases: shoop.front.checkout.CheckoutPhaseViewMixin, django.views.generic.edit.FormView

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

identifier = 'methods'
title = <django.utils.functional.lazy.<locals>.__proxy__ object>
template_name = 'shoop/front/checkout/methods.jinja'
form_class

alias of MethodsForm

is_valid()[source]
process()[source]
get_form_kwargs()[source]
form_valid(form)[source]
get_initial()[source]
class shoop.front.checkout.methods.ShippingMethodPhase(**kwargs)[source]

Bases: shoop.front.checkout.methods._MethodDependentCheckoutPhase, django.views.generic.base.View

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

identifier = 'shipping'
get_method()[source]
class shoop.front.checkout.methods.PaymentMethodPhase(**kwargs)[source]

Bases: shoop.front.checkout.methods._MethodDependentCheckoutPhase, django.views.generic.base.View

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

identifier = 'payment'
get_method()[source]

shoop.front.checkout.single_page module

class shoop.front.checkout.single_page.OrderForm(*args, **kwargs)[source]

Bases: shoop.front.checkout._mixins.TaxNumberCleanMixin, django.forms.forms.Form

limit_method_fields()[source]
base_fields = OrderedDict([('company_name', <django.forms.fields.CharField object at 0x7f53020d2198>), ('tax_number', <django.forms.fields.CharField object at 0x7f5301ff09b0>), ('shipping_method', <shoop.utils.fields.RelaxedModelChoiceField object at 0x7f5301eac630>), ('payment_method', <shoop.utils.fields.RelaxedModelChoiceField object at 0x7f53016166d8>), ('accept_terms', <django.forms.fields.BooleanField object at 0x7f5301dcbb38>), ('marketing', <django.forms.fields.BooleanField object at 0x7f5301816470>), ('comment', <django.forms.fields.CharField object at 0x7f53018166d8>)])
declared_fields = OrderedDict([('company_name', <django.forms.fields.CharField object at 0x7f53020d2198>), ('tax_number', <django.forms.fields.CharField object at 0x7f5301ff09b0>), ('shipping_method', <shoop.utils.fields.RelaxedModelChoiceField object at 0x7f5301eac630>), ('payment_method', <shoop.utils.fields.RelaxedModelChoiceField object at 0x7f53016166d8>), ('accept_terms', <django.forms.fields.BooleanField object at 0x7f5301dcbb38>), ('marketing', <django.forms.fields.BooleanField object at 0x7f5301816470>), ('comment', <django.forms.fields.CharField object at 0x7f53018166d8>)])
media
class shoop.front.checkout.single_page.SingleCheckoutPhase(**kwargs)[source]

Bases: shoop.front.checkout.CheckoutPhaseViewMixin, django.views.generic.edit.FormView

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

identifier = 'checkout'
final = True
template_name = 'shoop/front/checkout/single_phase.jinja'
billing_address_form_class

alias of AddressForm

shipping_address_form_class

alias of AddressForm

order_form_class

alias of OrderForm

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

Module contents

class shoop.front.checkout.BasicServiceCheckoutPhaseProvider

Bases: shoop.front.checkout.ServiceCheckoutPhaseProvider

Helper for implementing basic ServiceCheckoutPhaseProvider.

This helper should be useful for most cases, where one only has to provide a checkout phase for certain service provider type just by initializing some predefined class.

get_checkout_phase(checkout_process, service)[source]

Get checkout phase for given service.

Return type:shoop.front.checkout.CheckoutPhaseViewMixin|None
phase_class = None
service_provider_class = None
class shoop.front.checkout.CheckoutPhaseViewMixin

Bases: object

checkout_process = None
final = False
get_success_url()[source]
identifier = None
is_valid()[source]
next_phase = None
phases = ()
previous_phase = None
process()[source]
request = None
reset()[source]
should_skip()[source]
storage
title = None
class shoop.front.checkout.CheckoutProcess(phase_specs, phase_kwargs)

Bases: object

add_phase_attributes(target_phase, current_phase=None)[source]

Add phase instance attributes (previous, next, etc) to the given target phase, using the optional current_phase as the current phase for previous and next.

This is exposed as a public API for the benefit of phases that need to do sub-phase initialization and dispatching, such as method phases.

complete()[source]

To be called from a phase (self.checkout_process.complete()) when the checkout process is complete.

get_current_phase(requested_phase_identifier)[source]
get_next_phase(current_phase, target_phase)[source]
get_previous_phase(current_phase, target_phase)[source]
instantiate_phase_class(phase_class, **extra_kwargs)[source]
phases
Return type:Iterable[CheckoutPhaseViewMixin]
prepare_current_phase(phase_identifier)[source]
reset()[source]
class shoop.front.checkout.ServiceCheckoutPhaseProvider

Bases: object

Interface for providing checkout phase for a service.

Items specified in front_service_checkout_phase_provider provide category should implement this interface.

get_checkout_phase(checkout_process, service)[source]

Get checkout phase for given service.

If this provider is for another service, then the return value will be None.

Return type:shoop.front.checkout.CheckoutPhaseViewMixin|None