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 0x7f15c2d107b8>), ('phone', <django.forms.fields.CharField object at 0x7f15c2d0a2e8>), ('email', <django.forms.fields.EmailField object at 0x7f15c2d20f28>), ('street', <django.forms.fields.CharField object at 0x7f15c250c9b0>), ('street2', <django.forms.fields.CharField object at 0x7f15c2d20908>), ('postal_code', <django.forms.fields.CharField object at 0x7f15c3cd7828>), ('city', <django.forms.fields.CharField object at 0x7f15c3d8b128>), ('region', <django.forms.fields.CharField object at 0x7f15c2dcaf60>), ('country', <django_countries.fields.LazyTypedChoiceField object at 0x7f15c294d278>)])
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 0x7f15c24e44a8>), ('tax_number', <django.forms.fields.CharField object at 0x7f15c250cda0>)])
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 0x7f15c256cf28>), ('marketing', <django.forms.fields.BooleanField object at 0x7f15c256c630>), ('comment', <django.forms.fields.CharField object at 0x7f15c24d7128>)])
declared_fields = OrderedDict([('accept_terms', <django.forms.fields.BooleanField object at 0x7f15c256cf28>), ('marketing', <django.forms.fields.BooleanField object at 0x7f15c256c630>), ('comment', <django.forms.fields.CharField object at 0x7f15c24d7128>)])
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.MethodModelChoiceField(*args, **kwargs)[source]

Bases: django.forms.models.ModelChoiceField

label_from_instance(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', <shoop.front.checkout.methods.MethodModelChoiceField object at 0x7f15c258e048>), ('payment_method', <shoop.front.checkout.methods.MethodModelChoiceField object at 0x7f15c258e390>)])
declared_fields = OrderedDict([('shipping_method', <shoop.front.checkout.methods.MethodModelChoiceField object at 0x7f15c258e048>), ('payment_method', <shoop.front.checkout.methods.MethodModelChoiceField object at 0x7f15c258e390>)])
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.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 0x7f15c2494ef0>), ('phone', <django.forms.fields.CharField object at 0x7f15c243d0b8>), ('email', <django.forms.fields.EmailField object at 0x7f15c243d208>), ('street', <django.forms.fields.CharField object at 0x7f15c243d470>), ('street2', <django.forms.fields.CharField object at 0x7f15c243d588>), ('postal_code', <django.forms.fields.CharField object at 0x7f15c243d6a0>), ('city', <django.forms.fields.CharField object at 0x7f15c243d7b8>), ('region', <django.forms.fields.CharField object at 0x7f15c243d8d0>), ('country', <django_countries.fields.LazyTypedChoiceField object at 0x7f15c243da20>)])
AddressForm.declared_fields = OrderedDict()
AddressForm.media
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 0x7f15c243da90>), ('tax_number', <django.forms.fields.CharField object at 0x7f15c243dba8>), ('shipping_method', <shoop.utils.fields.RelaxedModelChoiceField object at 0x7f15c243dcc0>), ('payment_method', <shoop.utils.fields.RelaxedModelChoiceField object at 0x7f15c243de80>), ('accept_terms', <django.forms.fields.BooleanField object at 0x7f15c24a0080>), ('marketing', <django.forms.fields.BooleanField object at 0x7f15c24a0128>), ('comment', <django.forms.fields.CharField object at 0x7f15c24a0208>)])
declared_fields = OrderedDict([('company_name', <django.forms.fields.CharField object at 0x7f15c243da90>), ('tax_number', <django.forms.fields.CharField object at 0x7f15c243dba8>), ('shipping_method', <shoop.utils.fields.RelaxedModelChoiceField object at 0x7f15c243dcc0>), ('payment_method', <shoop.utils.fields.RelaxedModelChoiceField object at 0x7f15c243de80>), ('accept_terms', <django.forms.fields.BooleanField object at 0x7f15c24a0080>), ('marketing', <django.forms.fields.BooleanField object at 0x7f15c24a0128>), ('comment', <django.forms.fields.CharField object at 0x7f15c24a0208>)])
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.CheckoutPhaseViewMixin[source]

Bases: object

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

Bases: object

phases
Return type:Iterable[CheckoutPhaseViewMixin]
instantiate_phase_class(phase_class, **extra_kwargs)[source]
get_current_phase(requested_phase_identifier)[source]
get_next_phase(current_phase)[source]
get_previous_phase(current_phase)[source]
prepare_current_phase(phase_identifier)[source]
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.

reset()[source]
complete()[source]

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