django_program.registration.views

Views for the registration app.

Provides ticket selection, cart management, checkout, and order views scoped to a conference via the conference_slug URL kwarg.

Classes

CartView

Shopping cart view for adding/removing items and applying vouchers.

CheckoutView

Checkout view for creating an order from the current cart.

OrderConfirmationView

Confirmation page shown immediately after checkout.

OrderDetailView

Detail view for any order owned by the current user.

TicketSelectView

Lists available ticket types for a conference.

class django_program.registration.views.TicketSelectView[source]

Bases: ConferenceMixin, FeatureRequiredMixin, ListView

Lists available ticket types for a conference.

Shows ticket types that are active and do not require a voucher, ordered by display order and name.

required_feature: str | tuple[str, ...] = ('registration', 'public_ui')
template_name = 'django_program/registration/ticket_select.html'
context_object_name = 'ticket_types'
get_queryset()[source]

Return available public ticket types for the current conference.

Return type:

QuerySet

Returns:

A queryset of active, non-voucher-required TicketType instances.

get_context_data(**kwargs)[source]

Add current timestamp for availability display logic.

Parameters:

kwargs (object)

Return type:

dict[str, object]

class django_program.registration.views.CartView[source]

Bases: LoginRequiredMixin, ConferenceMixin, FeatureRequiredMixin, View

Shopping cart view for adding/removing items and applying vouchers.

Handles multiple POST actions distinguished by a hidden action field: add_item, remove_item, and apply_voucher.

required_feature: str | tuple[str, ...] = ('registration', 'public_ui')
template_name = 'django_program/registration/cart.html'
get(request, **kwargs)[source]

Render the cart page with current items and totals.

Handles an optional add_ticket query parameter to add a ticket by slug directly from the ticket selection page.

Parameters:
  • request (HttpRequest) – The incoming HTTP request.

  • **kwargs (str) – URL keyword arguments (unused).

Return type:

HttpResponse

Returns:

The rendered cart page (or redirect after adding a ticket).

post(request, **kwargs)[source]

Handle cart actions dispatched by the action hidden field.

Supported actions: add_item, add_ticket, add_addon, remove_item, apply_voucher, remove_voucher.

Parameters:
  • request (HttpRequest) – The incoming HTTP request.

  • **kwargs (str) – URL keyword arguments (unused).

Return type:

HttpResponse

Returns:

A redirect back to the cart page on success, or the cart page with errors on validation failure.

class django_program.registration.views.CheckoutView[source]

Bases: LoginRequiredMixin, ConferenceMixin, FeatureRequiredMixin, View

Checkout view for creating an order from the current cart.

Collects billing information, creates Order and OrderLineItem records inside a transaction, marks the cart as checked out, and redirects to the order confirmation page.

required_feature: str | tuple[str, ...] = ('registration', 'public_ui')
template_name = 'django_program/registration/checkout.html'
get(request, **kwargs)[source]

Render the checkout form with the cart summary.

Parameters:
  • request (HttpRequest) – The incoming HTTP request.

  • **kwargs (str) – URL keyword arguments (unused).

Return type:

HttpResponse

Returns:

The rendered checkout page, or a redirect to the cart if no open cart exists.

post(request, **kwargs)[source]

Validate billing info and create the order atomically.

Creates Order and OrderLineItem records from the cart, marks the cart as checked out, and sets a 30-minute hold on the order for inventory reservation.

Parameters:
  • request (HttpRequest) – The incoming HTTP request.

  • **kwargs (str) – URL keyword arguments (unused).

Return type:

HttpResponse

Returns:

A redirect to the order confirmation page on success, or the checkout form with errors on validation failure.

class django_program.registration.views.OrderConfirmationView[source]

Bases: LoginRequiredMixin, ConferenceMixin, FeatureRequiredMixin, DetailView

Confirmation page shown immediately after checkout.

Displays the order summary and line items for the just-completed checkout.

required_feature: str | tuple[str, ...] = ('registration', 'public_ui')
template_name = 'django_program/registration/order_confirmation.html'
context_object_name = 'order'
get_object(queryset=None)[source]

Look up the order by reference within the conference.

Ensures the order belongs to the requesting user.

Return type:

Order

Returns:

The matched Order instance.

Raises:

Http404 – If no matching order is found or the user does not own it.

Parameters:

queryset (QuerySet | None)

get_context_data(**kwargs)[source]

Add line items to the template context.

Return type:

dict[str, object]

Returns:

Context dict containing conference, order, and line_items.

Parameters:

kwargs (object)

class django_program.registration.views.OrderDetailView[source]

Bases: LoginRequiredMixin, ConferenceMixin, FeatureRequiredMixin, DetailView

Detail view for any order owned by the current user.

Displays order information, line items, and payment history.

required_feature: str | tuple[str, ...] = ('registration', 'public_ui')
template_name = 'django_program/registration/order_detail.html'
context_object_name = 'order'
get_object(queryset=None)[source]

Look up the order by reference within the conference.

Ensures the order belongs to the requesting user.

Return type:

Order

Returns:

The matched Order instance.

Raises:

Http404 – If no matching order is found or the user does not own it.

Parameters:

queryset (QuerySet | None)

get_context_data(**kwargs)[source]

Add line items and payments to the template context.

Return type:

dict[str, object]

Returns:

Context dict containing conference, order, line_items, and payments.

Parameters:

kwargs (object)