AKScheduling.api module

class AKScheduling.api.ResourceSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

REST Framework Serializer for Rooms to produce format required for fullcalendar resources

static transform_title(obj)[source]

Adapt title, add capacity information if room has a restriction (capacity is not -1)

class AKScheduling.api.ResourcesViewSet(**kwargs)[source]

Bases: EventSlugMixin, ListModelMixin, GenericViewSet

API View: Rooms (resources to schedule for in fullcalendar)

Read-only, adaption to fullcalendar format through ResourceSerializer

serializer_class

alias of ResourceSerializer

class AKScheduling.api.EventsView(**kwargs)[source]

Bases: LoginRequiredMixin, EventSlugMixin, ListView

API View: Slots (events to schedule in fullcalendar)

Read-only, JSON formatted response is created manually since it requires a bunch of “custom” fields that have different names compared to the normal model or are not present at all and need to be computed to create the required format for fullcalendar.

model

alias of AKSlot

class AKScheduling.api.RoomAvailabilitiesView(**kwargs)[source]

Bases: LoginRequiredMixin, EventSlugMixin, ListView

API view: Availabilities of rooms

Read-only, JSON formatted response is created manually since it requires a bunch of “custom” fields that have different names compared to the normal model or are not present at all and need to be computed to create the required format for fullcalendar.

model

alias of Availability

class AKScheduling.api.DefaultSlotsView(**kwargs)[source]

Bases: LoginRequiredMixin, EventSlugMixin, ListView

API view: default slots

Read-only, JSON formatted response is created manually since it requires a bunch of “custom” fields that have different names compared to the normal model or are not present at all and need to be computed to create the required format for fullcalendar.

model

alias of DefaultSlot

class AKScheduling.api.EventSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

REST framework serializer to adapt between AKSlot model and the event format of fullcalendar

class AKScheduling.api.ChangePermissionForPost[source]

Bases: DjangoModelPermissions

Model permissions requiring change permission for POST requests

Needed for actions that modify existing objects via POST (instead of creating new objects)

class AKScheduling.api.EventsViewSet(**kwargs)[source]

Bases: EventSlugMixin, UpdateModelMixin, GenericViewSet

API view: Update scheduling of a slot (event in fullcalendar format)

Write-only (will however reply with written values to PUT request). Slots can be removed from the schedule using the unschedule action.

serializer_class

alias of EventSerializer

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

Remove a slot from the schedule (i.e., reset its start and room)

Fixed slots cannot be unscheduled.

class AKScheduling.api.ConstraintViolationSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

REST Framework Serializer for constraint violations

static get_resolved_by_display(obj)[source]

Name of the user who marked the violation as resolved (empty if unknown or not resolved)

get_resolution_display(obj)[source]

Human-readable information about the manual resolution of the violation, i.e., who resolved it and why (empty if the violation is not manually resolved)

class AKScheduling.api.ConstraintViolationsViewSet(**kwargs)[source]

Bases: EventSlugMixin, ListModelMixin, GenericViewSet

API View: Constraint Violations of an event

Read-only, fields and model selected in ConstraintViolationSerializer

serializer_class

alias of ConstraintViolationSerializer