example_checkout package

Submodules

example_checkout.base module

Django settings

example_checkout.base.get_env_variable(key)[source]

Get the environment variable or return exception Copied from Django two scoops book

example_checkout.celery module

example_checkout.dev_greg module

example_checkout.dev_malcolm module

example_checkout.dev_patrick module

example_checkout.dev_test module

example_checkout.forms module

class example_checkout.forms.EmptyForm(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, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

base_fields = {}
declared_fields = {}
media
class example_checkout.forms.SalesLedgerCheckoutForm(*args, **kwargs)[source]

Bases: checkout.forms.CheckoutForm

class Meta[source]

Bases: object

fields = ('action',)
model

alias of example_checkout.models.SalesLedger

base_fields = {'action': <django.forms.fields.ChoiceField object>, 'token': <django.forms.fields.CharField object>}
declared_fields = {'action': <django.forms.fields.ChoiceField object>, 'token': <django.forms.fields.CharField object>}
media
class example_checkout.forms.SalesLedgerEmptyForm(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, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

fields = ()
model

alias of example_checkout.models.SalesLedger

base_fields = {}
declared_fields = {}
media

example_checkout.models module

class example_checkout.models.SalesLedger(*args, **kwargs)[source]

Bases: django.db.models.base.Model

List of prices.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

checkout_actions
checkout_can_charge

We can always take a payment for this object!

checkout_description
checkout_email
checkout_fail(checkout)[source]

Update the object to record the payment failure.

Called from within a transaction so you can update the model.

checkout_fail_url(checkout_pk)[source]

just for testing.

checkout_name
checkout_success(checkout)[source]

Update the object to record the payment success.

Called from within a transaction so you can update the model.

checkout_success_url(checkout_pk)[source]

just for testing.

checkout_total
contact

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

contact_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_absolute_url()[source]

just for testing.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

instalment_fail(checkout, due)[source]
instalment_success(checkout)[source]
objects = <example_checkout.models.SalesLedgerManager object>
product

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

product_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

quantity

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class example_checkout.models.SalesLedgerManager[source]

Bases: django.db.models.manager.Manager

create_sales_ledger(contact, product, quantity)[source]

example_checkout.urls module

example_checkout.urls.path(route, view, kwargs=None, name=None, *, Pattern=<class 'django.urls.resolvers.RoutePattern'>)

example_checkout.views module

class example_checkout.views.ExampleContactCardRefreshView(**kwargs)[source]

Bases: base.view_utils.BaseMixin, django.views.generic.base.TemplateView

template_name = 'example/settings.html'
class example_checkout.views.ExampleObjectPaymentPlanDepositChargeUpdateView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, braces.views._access.StaffuserRequiredMixin, django.views.generic.edit.UpdateView

form_class

alias of checkout.forms.ObjectPaymentPlanInstalmentEmptyForm

form_valid(form)[source]

If the form is valid, save the associated model.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

model

alias of checkout.models.ObjectPaymentPlanInstalment

template_name = 'example/object_payment_plan_deposit_charge.html'
class example_checkout.views.ExampleProcessPaymentsFormView(**kwargs)[source]

Bases: django.views.generic.edit.FormView

form_class

alias of example_checkout.forms.EmptyForm

form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

template_name = 'example/process_payments.html'
class example_checkout.views.ExampleRefreshExpiryDatesFormView(**kwargs)[source]

Bases: django.views.generic.edit.FormView

form_class

alias of example_checkout.forms.EmptyForm

form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

template_name = 'example/refresh_expiry_dates.html'
class example_checkout.views.ExampleReportContactOsFeesView(**kwargs)[source]

Bases: base.view_utils.BaseMixin, django.views.generic.base.TemplateView

template_name = 'example/settings.html'
class example_checkout.views.HomeView(**kwargs)[source]

Bases: django.views.generic.list.ListView

get_context_data(**kwargs)[source]

Get the context for this view.

model

alias of example_checkout.models.SalesLedger

template_name = 'example/home.html'
class example_checkout.views.SalesLedgerChargeUpdateView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, base.view_utils.BaseMixin, django.views.generic.edit.UpdateView

form_class

alias of example_checkout.forms.SalesLedgerEmptyForm

form_valid(form)[source]

If the form is valid, save the associated model.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

model

alias of example_checkout.models.SalesLedger

template_name = 'example/charge.html'
class example_checkout.views.SalesLedgerCheckoutSuccessView(**kwargs)[source]

Bases: checkout.views.CheckoutSuccessMixin, base.view_utils.BaseMixin, django.views.generic.detail.DetailView

template_name = 'example/checkout_success.html'
class example_checkout.views.SalesLedgerCheckoutView(**kwargs)[source]

Bases: checkout.views.CheckoutMixin, base.view_utils.BaseMixin, django.views.generic.edit.UpdateView

A charge can be made by the logged in user or an anonymous user.

form_class

alias of example_checkout.forms.SalesLedgerCheckoutForm

model

alias of example_checkout.models.SalesLedger

template_name = 'example/checkout.html'
class example_checkout.views.SalesLedgerSessionRedirectView(**kwargs)[source]

Bases: django.views.generic.base.RedirectView

Set session variable so permission checks pass in checkout.

get_redirect_url(*args, **kwargs)[source]

Return the URL redirect to. Keyword arguments from the URL pattern match generating the redirect request are provided as kwargs to this method.

permanent = False
class example_checkout.views.SettingsView(**kwargs)[source]

Bases: base.view_utils.BaseMixin, django.views.generic.base.TemplateView

template_name = 'example/settings.html'

example_checkout.wsgi module

Module contents