apis_core.collections.views#

Module Contents#

Classes#

ContentObjectMixin

Setup the ContentType and the object used by a view, based on the content_type_id and the object_id arguments passed in the URL.

CollectionObjectFormView

CollectionToggle

Toggle a collection - if a CollectionObject connecting the requested object and collection does not exist, then create it. If it does exist, delete it.

CollectionObjectCollection

Change the requested CollectionObjects collection to point to the collection the current collection is in.

CollectionSessionToggle

Toggle the existence of an SkosCollection in the session_collections session variable. This can be used in combination with the collections.signals.add_to_session_collection signal, to add objects to a collection if the collections id is listed in the session variable. The equivalent templateatag that calls this view is collections.templatetags.collections.collection_session_toggle_by_id

API#

class apis_core.collections.views.ContentObjectMixin#

Setup the ContentType and the object used by a view, based on the content_type_id and the object_id arguments passed in the URL.

setup(*args, **kwargs)#
get_context_data(*args, **kwargs)#
class apis_core.collections.views.CollectionObjectFormView(**kwargs)#

Bases: django.contrib.auth.mixins.LoginRequiredMixin, apis_core.generic.views.GenericModelMixin, django.views.generic.edit.FormView

template_name = 'collections/collection_object_form.html'#
form_class = None#
get_object()#
get_initial()#
get_success_url()#
form_valid(form)#
get_context_data(**kwargs)#
class apis_core.collections.views.CollectionToggle(**kwargs)#

Bases: django.contrib.auth.mixins.LoginRequiredMixin, apis_core.collections.views.ContentObjectMixin, django.views.generic.base.TemplateView

Toggle a collection - if a CollectionObject connecting the requested object and collection does not exist, then create it. If it does exist, delete it.

Initialization

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

template_name = 'collections/collection_toggle.html'#
setup(*args, **kwargs)#
get_context_data(*args, **kwargs)#
get(*args, **kwargs)#
class apis_core.collections.views.CollectionObjectCollection(**kwargs)#

Bases: django.contrib.auth.mixins.LoginRequiredMixin, apis_core.collections.views.ContentObjectMixin, django.views.generic.base.TemplateView

Change the requested CollectionObjects collection to point to the collection the current collection is in.

Initialization

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

template_name = 'collections/collection_object_collection.html'#
get_context_data(*args, **kwargs)#
class apis_core.collections.views.CollectionSessionToggle(**kwargs)#

Bases: django.contrib.auth.mixins.LoginRequiredMixin, django.views.generic.base.TemplateView

Toggle the existence of an SkosCollection in the session_collections session variable. This can be used in combination with the collections.signals.add_to_session_collection signal, to add objects to a collection if the collections id is listed in the session variable. The equivalent templateatag that calls this view is collections.templatetags.collections.collection_session_toggle_by_id

Initialization

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

template_name = 'collections/collection_session_toggle.html'#
get_context_data(*args, **kwargs)#
get(*args, **kwargs)#