django_program.pretalx.views

Views for the pretalx integration app.

Provides read-only schedule, talk, and speaker views scoped to a conference via the conference_slug URL kwarg. All views resolve the conference from the URL and return a 404 if the slug does not match.

Classes

ConferenceMixin

Mixin that resolves the conference from the conference_slug URL kwarg.

ScheduleJSONView

JSON endpoint for schedule data.

ScheduleView

Full schedule view grouped by day.

SpeakerDetailView

Detail view for a single speaker.

SpeakerListView

List view of all speakers for a conference, ordered by name.

TalkDetailView

Detail view for a single talk.

class django_program.pretalx.views.ConferenceMixin[source]

Bases: object

Mixin that resolves the conference from the conference_slug URL kwarg.

Stores the conference on self.conference and adds it to the template context. Returns a 404 if no conference matches the slug.

conference: Conference
kwargs: dict[str, str]
get_conference()[source]

Look up the conference by slug from the URL.

Return type:

Conference

Returns:

The matched conference instance.

Raises:

Http404 – If no conference matches the slug.

get_context_data(**kwargs)[source]

Add the conference to the template context.

Parameters:

**kwargs (object) – Additional context data.

Return type:

dict[str, object]

Returns:

The template context dict with the conference included.

dispatch(request, *args, **kwargs)[source]

Resolve the conference before dispatching.

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

  • *args (str) – Positional arguments from the URL resolver.

  • **kwargs (str) – Keyword arguments from the URL pattern.

Return type:

HttpResponse

Returns:

The HTTP response.

class django_program.pretalx.views.ScheduleView[source]

Bases: ConferenceMixin, FeatureRequiredMixin, TemplateView

Full schedule view grouped by day.

Renders the conference schedule with slots organized by date. Each day is a (date, list[ScheduleSlot]) tuple ordered by start time.

required_feature: str | tuple[str, ...] = 'public_ui'
template_name = 'django_program/pretalx/schedule.html'
get_context_data(**kwargs)[source]

Build schedule context grouped by day.

Return type:

dict[str, object]

Returns:

Context dict containing conference and days.

Parameters:

kwargs (object)

class django_program.pretalx.views.ScheduleJSONView[source]

Bases: ConferenceMixin, FeatureRequiredMixin, View

JSON endpoint for schedule data.

Returns a JSON array of schedule slots suitable for embedding in JavaScript schedule widgets. Each slot includes title, room, start/end times, slot type, and the linked talk code when available.

required_feature: str | tuple[str, ...] = 'public_ui'
get(_request, **_kwargs)[source]

Return schedule slots as a JSON array.

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

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

Return type:

JsonResponse

Returns:

A JSON response with the schedule data.

class django_program.pretalx.views.TalkDetailView[source]

Bases: ConferenceMixin, FeatureRequiredMixin, DetailView

Detail view for a single talk.

Looks up the talk by its Pretalx code within the conference scope. Prefetches the speakers relation for display.

required_feature: str | tuple[str, ...] = 'public_ui'
template_name = 'django_program/pretalx/talk_detail.html'
context_object_name = 'talk'
get_object(queryset=None)[source]

Look up the talk by conference and pretalx_code.

Return type:

Talk

Returns:

The matched Talk instance.

Raises:

Http404 – If no talk matches the conference and code.

Parameters:

queryset (QuerySet | None)

get_context_data(**kwargs)[source]

Add speakers to the template context.

Return type:

dict[str, object]

Returns:

Context dict containing conference, talk, and speakers.

Parameters:

kwargs (object)

class django_program.pretalx.views.SpeakerListView[source]

Bases: ConferenceMixin, FeatureRequiredMixin, ListView

List view of all speakers for a conference, ordered by name.

required_feature: str | tuple[str, ...] = 'public_ui'
template_name = 'django_program/pretalx/speaker_list.html'
context_object_name = 'speakers'
get_queryset()[source]

Return speakers for the current conference ordered by name.

Return type:

QuerySet

Returns:

A queryset of Speaker instances.

class django_program.pretalx.views.SpeakerDetailView[source]

Bases: ConferenceMixin, FeatureRequiredMixin, DetailView

Detail view for a single speaker.

Looks up the speaker by their Pretalx code within the conference scope. Prefetches talks for display.

required_feature: str | tuple[str, ...] = 'public_ui'
template_name = 'django_program/pretalx/speaker_detail.html'
context_object_name = 'speaker'
get_object(queryset=None)[source]

Look up the speaker by conference and pretalx_code.

Return type:

Speaker

Returns:

The matched Speaker instance.

Raises:

Http404 – If no speaker matches the conference and code.

Parameters:

queryset (QuerySet | None)

get_context_data(**kwargs)[source]

Add talks to the template context.

Return type:

dict[str, object]

Returns:

Context dict containing conference, speaker, and talks.

Parameters:

kwargs (object)