loefsys.reservations.views module

Module defining the class-based views for the reservations.

class loefsys.reservations.views.ReservationListView(**kwargs)

Bases: LoginRequiredMixin, ListView

Reservation list view.

model

alias of Reservation

context_object_name = 'reservations'
get_queryset()

Only show instances of Reservation made by the user, with the option to sort them.

get_context_data(**kwargs)

Include the sort form in the context data.

class loefsys.reservations.views.ReservationCreateView(**kwargs)

Bases: LoginRequiredMixin, CreateView

Reservation create view.

model

alias of Reservation

form_class

alias of CreateReservationForm

get_form(*args, **kwargs)

Include the location in the form.

form_valid(form)

Add the user who made the reservation to the Reservation instance.

get_context_data(**kwargs)

Include the location in the context data.

static check_availability(request)

Check if an item is available during the given timeslot.

class loefsys.reservations.views.ReservationUpdateView(**kwargs)

Bases: LoginRequiredMixin, UpdateView

Reservation update view.

model

alias of Reservation

form_class

alias of CreateReservationForm

get_form(*args, **kwargs)

Include the location in the form.

form_valid(form)

Add the user who made the reservation to the Reservation instance.

get_context_data(**kwargs)

Include the location in the context data.

get_queryset()

Only show instances of Reservation made by the user.

static check_availability(request)

Check if an item is available during the given timeslot.

Excluding the to be updated reservation as conflict.

class loefsys.reservations.views.ReservationDeleteView(**kwargs)

Bases: LoginRequiredMixin, DeleteView

Reservation delete view.

model

alias of Reservation

template_name = 'reservations/reservation_confirm_delete.html'
success_url = '/reservations/'
class loefsys.reservations.views.ReservationDetailView(**kwargs)

Bases: LoginRequiredMixin, DetailView

Reservation detail view.

model

alias of Reservation

get_queryset()

Only show instances of Reservation made by the user.

class loefsys.reservations.views.LogCreateView(**kwargs)

Bases: LoginRequiredMixin, CreateView

Reservation create view.

model

alias of Question

form_class

alias of CreateLogForm

get_form_kwargs()

Get form keyword arguments.