django_program.sponsors.views¶
Views for the sponsors app.
Provides sponsor listing and detail views scoped to a conference
via the conference_slug URL kwarg, plus a self-service portal
where sponsor contacts can view purchases, download voucher CSVs,
and request new bulk purchases.
Classes
Detail view for a specific bulk purchase. |
|
Export voucher codes for a bulk purchase as a CSV download. |
|
Form view for sponsors to request a new bulk voucher purchase. |
|
Detail view for a single sponsor. |
|
List view of all active sponsors for a conference, grouped by level. |
|
Permission mixin for the sponsor self-service portal. |
|
Landing page for the sponsor self-service portal. |
- class django_program.sponsors.views.SponsorListView[source]¶
Bases:
ConferenceMixin,FeatureRequiredMixin,ListViewList view of all active sponsors for a conference, grouped by level.
- template_name = 'django_program/sponsors/sponsor_list.html'¶
- context_object_name = 'sponsors'¶
- class django_program.sponsors.views.SponsorDetailView[source]¶
Bases:
ConferenceMixin,FeatureRequiredMixin,DetailViewDetail view for a single sponsor.
- template_name = 'django_program/sponsors/sponsor_detail.html'¶
- context_object_name = 'sponsor'¶
- class django_program.sponsors.views.SponsorPortalMixin[source]¶
Bases:
LoginRequiredMixinPermission mixin for the sponsor self-service portal.
Resolves the conference from the
conference_slugURL kwarg and verifies that the authenticated user’s email matches the sponsor’scontact_email, or that the user is staff/superuser.Sets
self.conferenceandself.sponsorfor use by subclasses.- conference: Conference¶
- dispatch(request, *args, **kwargs)[source]¶
Resolve the conference and sponsor, then enforce access.
Performs conference resolution and sponsor authorization BEFORE calling
super().dispatch()so thatself.conferenceandself.sponsorare available when the view method executes.- Parameters:
- Return type:
HttpResponse- Returns:
The HTTP response.
- Raises:
PermissionDenied – If the user is not authorized for this sponsor portal.
- class django_program.sponsors.views.SponsorPortalView[source]¶
Bases:
SponsorPortalMixin,TemplateViewLanding page for the sponsor self-service portal.
Shows sponsor info and a list of all bulk purchases with their current status.
- template_name = 'django_program/sponsors/portal_home.html'¶
- class django_program.sponsors.views.BulkPurchaseDetailView[source]¶
Bases:
SponsorPortalMixin,TemplateViewDetail view for a specific bulk purchase.
Shows all voucher codes associated with the purchase along with their redemption counts.
- template_name = 'django_program/sponsors/purchase_detail.html'¶
- class django_program.sponsors.views.BulkPurchaseExportCSVView[source]¶
Bases:
SponsorPortalMixin,ViewExport voucher codes for a bulk purchase as a CSV download.
- class django_program.sponsors.views.BulkPurchaseRequestView[source]¶
Bases:
SponsorPortalMixin,FormViewForm view for sponsors to request a new bulk voucher purchase.
Creates a BulkPurchase in PENDING state for organizer approval.
- template_name = 'django_program/sponsors/purchase_request.html'¶
- form_class¶
alias of
BulkPurchaseRequestForm
- form_valid(form)[source]¶
Create a pending BulkPurchase from the form data.
- Parameters:
form (
BulkPurchaseRequestForm) – The validated form instance.- Return type:
HttpResponse- Returns:
A redirect to the portal home page.