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
- integreat_cms.cms.views.organizations.organization_actions.delete(request: HttpRequest, region_slug: str, organization_id: int) HttpResponseRedirect [source]
Delete a single organization
Organization Bulk Actions
- class integreat_cms.cms.views.organizations.organization_bulk_actions.ArchiveBulkAction(**kwargs)[source]
Bases:
OrganizationBulkAction
Bulk action for archiving multiple organizations
- __init__(**kwargs)[source]
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- get_allow_empty()[source]
Return
True
if the view should display empty lists andFalse
if a 404 should be raised instead.
- get_extra_filters() Q [source]
Get extra filters for get_queryset(). Overwrite this method to specify needed filters e.g. as in ~integreat_cms.cms.views.contact.contact_bulk_actions
- Returns:
Q Object to be used as filter argument
- Return type:
Q
- get_paginate_by(queryset)[source]
Get the number of items to paginate by, or
None
for no pagination.
- get_paginate_orphans()[source]
Return the maximum number of orphans extend the last page by when paginating.
- get_paginator(queryset, per_page, orphans=0, allow_empty_first_page=True, **kwargs)[source]
Return an instance of the paginator for this view.
- get_permission_denied_message()[source]
Override this method to override the permission_denied_message attribute.
- get_permission_required() tuple[str] [source]
Override this method to override the permission_required attribute.
- get_queryset() Any [source]
Get the queryset of selected items for this bulk action
- Raises:
Http404 – HTTP status 404 if no objects with the given ids exist
- Returns:
The QuerySet of the filtered links
- Return type:
Any
- get_redirect_field_name()[source]
Override this method to override the redirect_field_name attribute.
- get_redirect_url(*args: Any, **kwargs: Any) str [source]
Retrieve url for redirection
- Parameters:
*args (Any) – The supplied arguments
**kwargs (Any) – The supplied keyword arguments
- Returns:
url to redirect to
- Return type:
- http_method_names: list[str] = ['post'][source]
The list of HTTP method names that this view will accept. The bulk action form uses only POST as submission method.
- model[source]
alias of
Organization
- post(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse [source]
Function to archive multiple organizations at once
- Parameters:
request (HttpRequest) – The current request
*args (Any) – The supplied arguments
**kwargs (Any) – The supplied keyword arguments
- Returns:
The redirect
- Return type:
HttpResponse
- class integreat_cms.cms.views.organizations.organization_bulk_actions.DeleteBulkAction(**kwargs)[source]
Bases:
OrganizationBulkAction
Bulk action for deleting multiple organizations
- __init__(**kwargs)[source]
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- get_allow_empty()[source]
Return
True
if the view should display empty lists andFalse
if a 404 should be raised instead.
- get_extra_filters() Q [source]
Get extra filters for get_queryset(). Overwrite this method to specify needed filters e.g. as in ~integreat_cms.cms.views.contact.contact_bulk_actions
- Returns:
Q Object to be used as filter argument
- Return type:
Q
- get_paginate_by(queryset)[source]
Get the number of items to paginate by, or
None
for no pagination.
- get_paginate_orphans()[source]
Return the maximum number of orphans extend the last page by when paginating.
- get_paginator(queryset, per_page, orphans=0, allow_empty_first_page=True, **kwargs)[source]
Return an instance of the paginator for this view.
- get_permission_denied_message()[source]
Override this method to override the permission_denied_message attribute.
- get_permission_required() tuple[str] [source]
This method overwrites get_permission_required() :return: The needed permission to delete contacts
- get_queryset() Any [source]
Get the queryset of selected items for this bulk action
- Raises:
Http404 – HTTP status 404 if no objects with the given ids exist
- Returns:
The QuerySet of the filtered links
- Return type:
Any
- get_redirect_field_name()[source]
Override this method to override the redirect_field_name attribute.
- get_redirect_url(*args: Any, **kwargs: Any) str [source]
Retrieve url for redirection
- Parameters:
*args (Any) – The supplied arguments
**kwargs (Any) – The supplied keyword arguments
- Returns:
url to redirect to
- Return type:
- http_method_names: list[str] = ['post'][source]
The list of HTTP method names that this view will accept. The bulk action form uses only POST as submission method.
- model[source]
alias of
Organization
- post(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse [source]
Function to delete multiple organizations at once
- Parameters:
request (HttpRequest) – The current request
*args (Any) – The supplied arguments
**kwargs (Any) – The supplied keyword arguments
- Returns:
The redirect
- Return type:
HttpResponse
- class integreat_cms.cms.views.organizations.organization_bulk_actions.OrganizationBulkAction(**kwargs)[source]
Bases:
BulkActionView
View for executing organization bulk actions
- __init__(**kwargs)[source]
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- get_allow_empty()[source]
Return
True
if the view should display empty lists andFalse
if a 404 should be raised instead.
- get_extra_filters() Q [source]
Get extra filters for get_queryset(). Overwrite this method to specify needed filters e.g. as in ~integreat_cms.cms.views.contact.contact_bulk_actions
- Returns:
Q Object to be used as filter argument
- Return type:
Q
- get_paginate_by(queryset)[source]
Get the number of items to paginate by, or
None
for no pagination.
- get_paginate_orphans()[source]
Return the maximum number of orphans extend the last page by when paginating.
- get_paginator(queryset, per_page, orphans=0, allow_empty_first_page=True, **kwargs)[source]
Return an instance of the paginator for this view.
- get_permission_denied_message()[source]
Override this method to override the permission_denied_message attribute.
- get_permission_required() tuple[str] [source]
Override this method to override the permission_required attribute.
- get_queryset() Any [source]
Get the queryset of selected items for this bulk action
- Raises:
Http404 – HTTP status 404 if no objects with the given ids exist
- Returns:
The QuerySet of the filtered links
- Return type:
Any
- get_redirect_field_name()[source]
Override this method to override the redirect_field_name attribute.
- get_redirect_url(*args: Any, **kwargs: Any) str [source]
Retrieve url for redirection
- Parameters:
*args (Any) – The supplied arguments
**kwargs (Any) – The supplied keyword arguments
- Returns:
url to redirect to
- Return type:
- http_method_names: list[str] = ['post'][source]
The list of HTTP method names that this view will accept. The bulk action form uses only POST as submission method.
- model[source]
The model of this
BulkActionView
- Parameters:
id (BigAutoField) – Primary key: ID
name (CharField) – Name
slug (SlugField) – Slug. Unique string identifier without spaces and special characters.
last_updated (DateTimeField) – Modification date
created_date (DateTimeField) – Creation date
website (URLField) – Website
archived (BooleanField) – Archived
Relationship fields:
- Parameters:
icon (
ForeignKey
toMediaFile
) – Logo (related name:icon_organizations
)region (
ForeignKey
toRegion
) – Region (related name:organizations
)links (
GenericRelation
toLink
) – Links (related name:organization
)
Reverse relationships:
- Parameters:
pois (Reverse
ForeignKey
fromPOI
) – All pois of this organization (related name oforganization
)pages (Reverse
ForeignKey
fromPage
) – All pages of this organization (related name oforganization
)members (Reverse
ForeignKey
fromUser
) – All members of this organization (related name oforganization
)
alias of
Organization
- class integreat_cms.cms.views.organizations.organization_bulk_actions.RestoreBulkAction(**kwargs)[source]
Bases:
OrganizationBulkAction
Bulk action for restoring multiple organizations
- __init__(**kwargs)[source]
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- get_allow_empty()[source]
Return
True
if the view should display empty lists andFalse
if a 404 should be raised instead.
- get_extra_filters() Q [source]
Get extra filters for get_queryset(). Overwrite this method to specify needed filters e.g. as in ~integreat_cms.cms.views.contact.contact_bulk_actions
- Returns:
Q Object to be used as filter argument
- Return type:
Q
- get_paginate_by(queryset)[source]
Get the number of items to paginate by, or
None
for no pagination.
- get_paginate_orphans()[source]
Return the maximum number of orphans extend the last page by when paginating.
- get_paginator(queryset, per_page, orphans=0, allow_empty_first_page=True, **kwargs)[source]
Return an instance of the paginator for this view.
- get_permission_denied_message()[source]
Override this method to override the permission_denied_message attribute.
- get_permission_required() tuple[str] [source]
Override this method to override the permission_required attribute.
- get_queryset() Any [source]
Get the queryset of selected items for this bulk action
- Raises:
Http404 – HTTP status 404 if no objects with the given ids exist
- Returns:
The QuerySet of the filtered links
- Return type:
Any
- get_redirect_field_name()[source]
Override this method to override the redirect_field_name attribute.
- get_redirect_url(*args: Any, **kwargs: Any) str [source]
Retrieve url for redirection
- Parameters:
*args (Any) – The supplied arguments
**kwargs (Any) – The supplied keyword arguments
- Returns:
url to redirect to
- Return type:
- http_method_names: list[str] = ['post'][source]
The list of HTTP method names that this view will accept. The bulk action form uses only POST as submission method.
- model[source]
alias of
Organization
- post(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse [source]
Function to restore multiple organizations at once
- Parameters:
request (HttpRequest) – The current request
*args (Any) – The supplied arguments
**kwargs (Any) – The supplied keyword arguments
- Returns:
The redirect
- Return type:
HttpResponse
Organization Content Mixin
- class integreat_cms.cms.views.organizations.organization_content_mixin.OrganizationContextMixin[source]
Bases:
ContextMixin
This mixin provides extra context for organization views
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.
- 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()
).
- 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.
- 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
- template_name = 'organizations/organization_form.html'[source]
The template to render (see
TemplateResponseMixin
)
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.
- 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()
).
- 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.
- 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