Linkcheck

This package contains views for the broken link checker

Linkcheck List View

class integreat_cms.cms.views.linkcheck.linkcheck_list_view.LinkcheckListView(**kwargs)[source]

Bases: ListView

View for retrieving a list of urls grouped by their state

__init__(**kwargs)[source]

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

allow_empty = True[source]
classmethod as_view(**initkwargs)[source]

Main entry point for a request-response process.

content_type = None[source]
context_object_name: str = 'filtered_urls'[source]

Designates the name of the variable to use in the context (see MultipleObjectMixin)

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

Dispatch the view to either get() or post()

Parameters:
  • request (HttpRequest)

  • args (Any)

  • kwargs (Any)

Return type:

HttpResponse

extra_context: dict[str, str | int] = {'LINKCHECK_EMAIL_ENABLED': True, 'LINKCHECK_PHONE_ENABLED': True, 'current_menu_item': 'linkcheck'}[source]

The context dict passed to the template (see ContextMixin)

form: EditUrlForm | None = None[source]

The link edit form

get(request: HttpRequest, *args: Any, **kwargs: Any) TemplateResponse[source]

Return the get view and fall back to the last page if the requested page does not exist

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

  • *args (Any) – The supplied arguments

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

Raises:

Http404 – When the view returns a 404 and already requests the last page

Returns:

The rendered linkcheck template or a redirect to the last page

Return type:

TemplateResponse

get_allow_empty()[source]

Return True if the view should display empty lists and False if a 404 should be raised instead.

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

Extend context by edit url form

Parameters:

**kwargs (Any) – The supplied keyword arguments

Returns:

The context dictionary

Return type:

dict[str, Any]

get_context_object_name(object_list)[source]

Get the name of the item to be used in the context.

get_ordering()[source]

Return the field or fields to use for ordering the queryset.

get_paginate_by(queryset: list[Url]) int[source]

Get the number of items to paginate by, or None for no pagination.

Parameters:

queryset (list[Url]) – The QuerySet of the filtered urls

Returns:

The pagination number

Return type:

int

get_paginate_orphans()[source]

Return the maximum number of orphans extend the last page by when paginating.

get_pagination_params() str[source]

Get the urlencoded pagination GET parameters

Returns:

The URL params

Return type:

str

get_paginator(queryset, per_page, orphans=0, allow_empty_first_page=True, **kwargs)[source]

Return an instance of the paginator for this view.

get_queryset() list[Url][source]

Selects all urls for the current region Finally annotates queryset by the content_type title

Returns:

The QuerySet of the filtered urls

Return type:

list[Url]

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]
instance: Url | None = None[source]

The currently edited instance

model = None[source]
options(request, *args, **kwargs)[source]

Handle responding to requests for the OPTIONS HTTP verb.

ordering = None[source]
page_kwarg = 'page'[source]
paginate_by = None[source]
paginate_orphans = 0[source]
paginate_queryset(queryset, page_size)[source]

Paginate the queryset, if needed.

paginator_class[source]

alias of Paginator

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

Applies selected action for selected urls

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

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

Raises:

Http404 – HTTP status 404 if the edited URL does not exist

Returns:

Redirect to current linkcheck tab

Return type:

HttpResponse

queryset = None[source]
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: str = 'linkcheck/links_by_filter.html'[source]

The template to render (see TemplateResponseMixin)

template_name_suffix = '_list'[source]
view_is_async = False[source]

Linkcheck Redirect View

class integreat_cms.cms.views.linkcheck.linkcheck_redirect_view.LinkcheckRedirectView(**kwargs)[source]

Bases: RedirectView

View for redirecting to main page of the broken link checker

__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.

delete(request, *args, **kwargs)[source]
dispatch(request, *args, **kwargs)[source]
get(request, *args, **kwargs)[source]
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:

str

head(request, *args, **kwargs)[source]
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.

patch(request, *args, **kwargs)[source]
pattern_name = None[source]
permanent = False[source]
post(request, *args, **kwargs)[source]
put(request, *args, **kwargs)[source]
query_string = False[source]
setup(request, *args, **kwargs)[source]

Initialize attributes shared by all view methods.

url = None[source]
view_is_async = False[source]

Linkcheck Stats View

class integreat_cms.cms.views.linkcheck.linkcheck_stats_view.LinkcheckStatsView(**kwargs)[source]

Bases: View

Return the linkcheck counter stats

__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.

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

Retrieve the stats about valid/invalid/unchecked/ignored links

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

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

Returns:

The rendered template response

Return type:

HttpResponse

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.

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

Initialize attributes shared by all view methods.

view_is_async = False[source]