events.api.viewsets package

Submodules

events.api.viewsets.event_registrations module

class events.api.viewsets.event_registrations.EventRegistrationViewSet(**kwargs)[source]

Bases: rest_framework.viewsets.GenericViewSet, rest_framework.mixins.RetrieveModelMixin, rest_framework.mixins.UpdateModelMixin

Defines the viewset for registrations, requires an authenticated user. Has custom update and destroy methods that use the services.

basename = None
description = None
destroy(request, pk=None, **kwargs)[source]
detail = None
get_object()[source]

Returns the object the view is displaying.

You may want to override this if you need to provide non-standard queryset lookups. Eg if objects are referenced using multiple keyword arguments in the url conf.

get_serializer(*args, **kwargs)[source]

Return the serializer instance that should be used for validating and deserializing input, and for serializing output.

get_serializer_context()[source]

Extra context provided to the serializer class.

name = None
perform_update(serializer)[source]
permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>]
queryset
serializer_class

alias of events.api.serializers.event_registrations.list.EventRegistrationSerializer

suffix = None

events.api.viewsets.events module

class events.api.viewsets.events.EventViewset(**kwargs)[source]

Bases: rest_framework.viewsets.ReadOnlyModelViewSet

Defines the viewset for events, requires an authenticated user and enables ordering on the event start/end.

basename = None
calendarjs(request)[source]

Defines a custom route that outputs the correctly formatted events information for CalendarJS, published events only :param request: the request object

Returns

response containing the data

description = None
detail = None
filter_backends = (<class 'rest_framework.filters.OrderingFilter'>, <class 'rest_framework.filters.SearchFilter'>)
get_queryset()[source]

Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.

This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.

You may want to override this if you need to provide different querysets depending on the incoming request.

(Eg. return a list of items that is specific to the user)

get_serializer_class()[source]

Return the class to use for the serializer. Defaults to using self.serializer_class.

You may want to override this if you need to provide different serializations depending on the incoming request.

(Eg. admins get full serialization, others get basic serialization)

get_serializer_context()[source]

Extra context provided to the serializer class.

name = None
ordering_fields = ('start', 'end')
permission_classes = [<class 'rest_framework.permissions.IsAuthenticatedOrReadOnly'>]
queryset
registrations(request, pk)[source]

Defines a custom route for the event’s registrations, can filter on registration status if the user is an organiser

Parameters
  • request – the request object

  • pk – the primary key of the event

Returns

the registrations of the event

search_fields = ('title_en', 'title_nl')
suffix = None
unpublished(request)[source]

Defines a custom route that outputs the correctly formatted events information for CalendarJS, unpublished events only

Parameters

request – the request object

Returns

response containing the data