django_program.manage.views_bulk_purchases

Views for bulk purchase management in the organizer dashboard.

Classes

BulkPurchaseApproveView

Approve a pending bulk purchase (POST-only).

BulkPurchaseCreateView

Create a new bulk purchase on behalf of a sponsor.

BulkPurchaseDetailView

Display full details of a bulk purchase with its generated voucher codes.

BulkPurchaseFulfillView

Trigger voucher generation for a paid bulk purchase (POST-only).

BulkPurchaseListView

List all bulk purchases for the current conference.

class django_program.manage.views_bulk_purchases.BulkPurchaseListView[source]

Bases: ConferencePermissionMixin, ListView

List all bulk purchases for the current conference.

Supports optional filtering by payment status via the ?status= query parameter.

template_name = 'django_program/manage/bulk_purchase_list.html'
required_permission: str = 'view_bulk_purchases'
context_object_name = 'bulk_purchases'
paginate_by = 50
get_context_data(**kwargs)[source]

Add active_nav and status filter choices to the template context.

Parameters:

kwargs (object)

Return type:

dict[str, object]

get_queryset()[source]

Return bulk purchases for the current conference, optionally filtered by status.

Return type:

QuerySet

class django_program.manage.views_bulk_purchases.BulkPurchaseDetailView[source]

Bases: ConferencePermissionMixin, DetailView

Display full details of a bulk purchase with its generated voucher codes.

template_name = 'django_program/manage/bulk_purchase_detail.html'
required_permission: str = 'view_bulk_purchases'
context_object_name = 'purchase'
get_context_data(**kwargs)[source]

Add active_nav and related voucher data to the template context.

Parameters:

kwargs (object)

Return type:

dict[str, object]

get_queryset()[source]

Scope to the current conference.

Return type:

QuerySet

class django_program.manage.views_bulk_purchases.BulkPurchaseCreateView[source]

Bases: ConferencePermissionMixin, CreateView

Create a new bulk purchase on behalf of a sponsor.

template_name = 'django_program/manage/bulk_purchase_form.html'
required_permission: str = 'change_bulk_purchases'
form_class

alias of BulkPurchaseCreateForm

get_context_data(**kwargs)[source]

Add active_nav and is_create to the template context.

Parameters:

kwargs (object)

Return type:

dict[str, object]

get_form(form_class=None)[source]

Scope sponsor, ticket type, and add-on querysets to the current conference.

Parameters:

form_class (type[BulkPurchaseCreateForm] | None)

Return type:

BulkPurchaseCreateForm

form_valid(form)[source]

Assign the conference and requesting user before saving.

Parameters:

form (BulkPurchaseCreateForm)

Return type:

HttpResponse

get_success_url()[source]

Redirect to the bulk purchase list.

Return type:

str

class django_program.manage.views_bulk_purchases.BulkPurchaseApproveView[source]

Bases: ConferencePermissionMixin, View

Approve a pending bulk purchase (POST-only).

Sets the payment status to APPROVED and records the approving user. The organizer must still configure voucher details and pricing before fulfillment can proceed.

required_permission: str = 'change_bulk_purchases'
post(request, **kwargs)[source]

Mark the bulk purchase as approved.

Parameters:
  • request (HttpRequest)

  • kwargs (str)

Return type:

HttpResponse

class django_program.manage.views_bulk_purchases.BulkPurchaseFulfillView[source]

Bases: ConferencePermissionMixin, View

Trigger voucher generation for a paid bulk purchase (POST-only).

Generates voucher codes using the stored voucher_config and links them back to the purchase via BulkPurchaseVoucher records.

required_permission: str = 'change_bulk_purchases'
post(request, **kwargs)[source]

Generate vouchers for the bulk purchase.

Parameters:
  • request (HttpRequest)

  • kwargs (str)

Return type:

HttpResponse