Linkcheck
This package contains views for the broken link checker
Link Replace View
- class integreat_cms.cms.views.linkcheck.link_replace_view.LinkReplaceView(**kwargs)[source]
Bases:
TemplateView
View for link replace form
- get(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse [source]
Render link replace form
- 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
- post(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse [source]
Applies link replace form
- 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 broken link list
- Return type:
HttpResponse
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
- 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
)
- 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_paginate_by(queryset: list[Url]) int [source]
Get the number of items to paginate by, or
None
for no pagination.
- get_pagination_params() str [source]
Get the urlencoded pagination GET parameters
- Returns:
The URL params
- Return type:
- 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]
- 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
- template_name: str = 'linkcheck/links_by_filter.html'[source]
The template to render (see
TemplateResponseMixin
)
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
Linkcheck Stats View
- class integreat_cms.cms.views.linkcheck.linkcheck_stats_view.LinkcheckStatsView(**kwargs)[source]
Bases:
View
Return the linkcheck counter stats
- 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