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
Shopping cart view for adding/removing items and applying vouchers. |
|
Checkout view for creating an order from the current cart. |
|
Confirmation page shown immediately after checkout. |
|
Detail view for any order owned by the current user. |
|
Lists available ticket types for a conference. |
- class django_program.registration.views.TicketSelectView[source]¶
Bases:
ConferenceMixin,FeatureRequiredMixin,ListViewLists available ticket types for a conference.
Shows ticket types that are active and do not require a voucher, ordered by display order and name.
- template_name = 'django_program/registration/ticket_select.html'¶
- context_object_name = 'ticket_types'¶
- class django_program.registration.views.CartView[source]¶
Bases:
LoginRequiredMixin,ConferenceMixin,FeatureRequiredMixin,ViewShopping cart view for adding/removing items and applying vouchers.
Handles multiple POST actions distinguished by a hidden
actionfield:add_item,remove_item, andapply_voucher.- template_name = 'django_program/registration/cart.html'¶
- get(request, **kwargs)[source]¶
Render the cart page with current items and totals.
Handles an optional
add_ticketquery 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
actionhidden 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,ViewCheckout 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.
- 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,DetailViewConfirmation page shown immediately after checkout.
Displays the order summary and line items for the just-completed checkout.
- template_name = 'django_program/registration/order_confirmation.html'¶
- context_object_name = 'order'¶
- class django_program.registration.views.OrderDetailView[source]¶
Bases:
LoginRequiredMixin,ConferenceMixin,FeatureRequiredMixin,DetailViewDetail view for any order owned by the current user.
Displays order information, line items, and payment history.
- template_name = 'django_program/registration/order_detail.html'¶
- context_object_name = 'order'¶