Organizations

This package contains all views related to organizations

Organization Actions

This module contains action methods for organizations (archive, restore)

integreat_cms.cms.views.organizations.organization_actions.archive(request: HttpRequest, region_slug: str, organization_id: int) HttpResponseRedirect[source]

Set archived flag for an organization

Parameters:
  • request (HttpRequest) – Object representing the user call

  • region_slug (str) – slug of the region to which an organization belongs

  • organization_id (int) – id of the event to be archived

Returns:

The rendered template response

Return type:

HttpResponseRedirect

integreat_cms.cms.views.organizations.organization_actions.delete(request: HttpRequest, region_slug: str, organization_id: int) HttpResponseRedirect[source]

Delete a single organization

Parameters:
  • request (HttpRequest) – Object representing the user call

  • region_slug (str) – slug of the region which the organization belongs to

  • organization_id (int) – id of the event to be deleted

Returns:

The rendered template response

Return type:

HttpResponseRedirect

integreat_cms.cms.views.organizations.organization_actions.restore(request: HttpRequest, region_slug: str, organization_id: int) HttpResponseRedirect[source]

Remove archived flag for an organization

Parameters:
  • request (HttpRequest) – Object representing the user call

  • region_slug (str) – slug of the region to which the organization belongs

  • organization_id (int) – id of the event to be restored

Returns:

The rendered template response

Return type:

HttpResponseRedirect

Organization Content Mixin

class integreat_cms.cms.views.organizations.organization_content_mixin.OrganizationContextMixin[source]

Bases: ContextMixin

This mixin provides extra context for organization views

__init__()[source]
extra_context = None[source]
get_context_data(**kwargs: Any) dict[str, Any][source]

Returns a dictionary representing the template context (see get_context_data()).

Parameters:

**kwargs (Any) – The given keyword arguments

Returns:

The template context

Return type:

dict[str, Any]

Organization Form View

class integreat_cms.cms.views.organizations.organization_form_view.OrganizationFormView(**kwargs)[source]

Bases: TemplateView, OrganizationContextMixin, MediaContextMixin

Class for rendering the organizations form

__init__(**kwargs)[source]

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

classmethod as_view(**initkwargs)[source]

Main entry point for a request-response process.

content_type = None[source]
dispatch(request, *args, **kwargs)[source]
extra_context = None[source]
get(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse[source]

Render organization form for HTTP GET requests

Parameters:
  • request (HttpRequest) – Object representing the user call

  • *args (Any) – The supplied arguments

  • **kwargs (Any) – The supplied keyword arguments

Returns:

The rendered template response

Return type:

HttpResponse

get_context_data(**kwargs: Any) dict[str, Any][source]

Returns a dictionary representing the template context (see get_context_data()).

Parameters:

**kwargs (Any) – The given keyword arguments

Returns:

The template context

Return type:

dict[str, Any]

get_template_names()[source]

Return a list of template names to be used for the request. Must return a list. May not be called if render_to_response() is overridden.

http_method_names = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace'][source]
http_method_not_allowed(request, *args, **kwargs)[source]
options(request, *args, **kwargs)[source]

Handle responding to requests for the OPTIONS HTTP verb.

post(request: HttpRequest, **kwargs: Any) HttpResponse[source]

Save organization form for HTTP POST requests

Parameters:
  • request (HttpRequest) – Object representing the user call

  • **kwargs (Any) – The supplied keyword arguments

Returns:

The rendered template response

Return type:

HttpResponse

render_to_response(context, **response_kwargs)[source]

Return a response, using the response_class for this view, with a template rendered with the given context.

Pass response_kwargs to the constructor of the response class.

response_class[source]

alias of TemplateResponse

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

Initialize attributes shared by all view methods.

template_engine = None[source]
template_name = 'organizations/organization_form.html'[source]

The template to render (see TemplateResponseMixin)

view_is_async = False[source]

Organization List View

class integreat_cms.cms.views.organizations.organization_list_view.OrganizationListView(**kwargs)[source]

Bases: TemplateView, OrganizationContextMixin

View for listing organizations (either non-archived or archived organizations depending on archived)

__init__(**kwargs)[source]

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

archived = False[source]

Whether or not to show archived organizations

classmethod as_view(**initkwargs)[source]

Main entry point for a request-response process.

content_type = None[source]
dispatch(request, *args, **kwargs)[source]
extra_context = None[source]
get(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse[source]

Render organizations list for HTTP GET requests

Parameters:
  • request (HttpRequest) – Object representing the user call

  • *args (Any) – The supplied arguments

  • **kwargs (Any) – The supplied keyword arguments

Returns:

The rendered template response

Return type:

HttpResponse

get_context_data(**kwargs: Any) dict[str, Any][source]

Returns a dictionary representing the template context (see get_context_data()).

Parameters:

**kwargs (Any) – The given keyword arguments

Returns:

The template context

Return type:

dict[str, Any]

get_template_names()[source]

Return a list of template names to be used for the request. Must return a list. May not be called if render_to_response() is overridden.

http_method_names = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace'][source]
http_method_not_allowed(request, *args, **kwargs)[source]
options(request, *args, **kwargs)[source]

Handle responding to requests for the OPTIONS HTTP verb.

render_to_response(context, **response_kwargs)[source]

Return a response, using the response_class for this view, with a template rendered with the given context.

Pass response_kwargs to the constructor of the response class.

response_class[source]

alias of TemplateResponse

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

Initialize attributes shared by all view methods.

template_engine = None[source]
template_name = 'organizations/organization_list.html'[source]

Template for list of non-archived organizations

view_is_async = False[source]