calingen.views.event¶
Views related to the calingen.models.event.Event model.
Module Contents¶
Classes¶
Generic class-based view implementation to add |
|
Generic class-based view implementation to delete |
|
Provide details of a |
|
Provide a list of |
|
Generic class-based view implementation to update |
- class calingen.views.event.EventCreateView(**kwargs)¶
Bases:
django.contrib.auth.mixins.LoginRequiredMixin,calingen.views.mixins.ProfileIDMixin,django.views.generic.CreateViewGeneric class-based view implementation to add
calingen.models.event.Eventobjects.Notes
This implementation uses Django’s generic class-based view
django.views.generic.CreateView.The view relies on
calingen.models.event.EventFormas itsModelForm. This is required to make custom validation logic available.- form_class¶
Specify which form to use.
- model¶
Required attribute to tie this view to the model.
- success_url¶
The URL to redirect to after successfully creating the instance.
- template_name_suffix = _create¶
Make the view use the template
calingen/event_create.html.
- form_valid(form)¶
Inject the user’s
Profileinto the form.Every user does have only one
ProfileandEventinstances are directly tied to thatProfile.The
EventForm`does not include the field to select theProfile, as user’s are only allowed to createEventinstances for themselves.This method injects the user’s
Profileinto theform.instanceto maintain database integrity.
- class calingen.views.event.EventDeleteView(*args, **kwargs)¶
Bases:
calingen.views.mixins.RestrictToUserMixin,django.contrib.auth.mixins.LoginRequiredMixin,calingen.views.mixins.ProfileIDMixin,django.views.generic.DeleteViewGeneric class-based view implementation to delete
calingen.models.event.Eventobjects.Notes
This implementation uses Django’s generic class-based view
django.views.generic.DeleteView.- context_object_name = event_item¶
Provide a semantic name for the built-in context.
- model¶
Required attribute to tie this view to the model.
- pk_url_kwarg = event_id¶
The name of the keyword argument as provided in the app’s url configuration.
By default, this is simply
"pk", but for clarity, the app’s url configuration (calingen.urls) uses the more explicit"event_id".
- success_url¶
The URL to redirect to after successfully deleting the instance.
- class calingen.views.event.EventDetailView(**kwargs)¶
Bases:
calingen.views.mixins.RestrictToUserMixin,django.contrib.auth.mixins.LoginRequiredMixin,calingen.views.mixins.ProfileIDMixin,django.views.generic.DetailViewProvide details of a
calingen.models.event.Eventinstance.Notes
This implementation uses Django’s generic class-based view
django.views.generic.DetailView.- context_object_name = event_item¶
Provide a semantic name for the built-in context.
- model¶
Required attribute to tie this view to the model.
- pk_url_kwarg = event_id¶
The name of the keyword argument as provided in the app’s url configuration.
By default, this is simply
"pk", but for clarity, the app’s url configuration (calingen.urls) uses the more explicit"event_id".
- class calingen.views.event.EventListView(**kwargs)¶
Bases:
calingen.views.mixins.RestrictToUserMixin,django.contrib.auth.mixins.LoginRequiredMixin,calingen.views.mixins.ProfileIDMixin,django.views.generic.ListViewProvide a list of
calingen.models.event.Eventinstances.Notes
This implementation uses Django’s generic class-based view
django.views.generic.ListView.- context_object_name = event_list¶
Provide a semantic name for the built-in context.
- model¶
Required attribute to tie this view to the model.
- class calingen.views.event.EventUpdateView(**kwargs)¶
Bases:
calingen.views.mixins.RestrictToUserMixin,django.contrib.auth.mixins.LoginRequiredMixin,calingen.views.mixins.ProfileIDMixin,django.views.generic.UpdateViewGeneric class-based view implementation to update
calingen.models.event.Eventobjects.Notes
This implementation uses Django’s generic class-based view
django.views.generic.UpdateView.The view relies on
calingen.models.event.EventFormas itsModelForm. This is required to make custom validation logic available.- form_class¶
Specify which form to use.
- model¶
Required attribute to tie this view to the model.
- pk_url_kwarg = event_id¶
The name of the keyword argument as provided in the app’s url configuration.
By default, this is simply
"pk", but for clarity, the app’s url configuration (calingen.urls) uses the more explicit"event_id".
- success_url¶
The URL to redirect to after successfully updating the instance.
- template_name_suffix = _update¶
Make the view use the template
calingen/event_update.html.