ListView

This module contains views to implement the React.

Guardrail list view in the Smarter Dashboard.

class smarter.apps.guardrail.views.listview.view.GuardrailListView(**kwargs)[source]

Bases: SmarterAuthenticatedNeverCachedWebView

Render the guardrail list view for the Smarter Workbench web console.

This view displays all guardrails available to the authenticated user as cards, providing a quick overview and access to guardrail details.

Parameters:
  • request (ASGIRequest) – Django HTTP request object.

  • args (tuple) – Additional positional arguments.

  • kwargs (dict) – Additional keyword arguments.

Returns:

Rendered HTML page with a card for each guardrail, or a 404 error page if the user is not authenticated.

Return type:

HttpResponse

property formatted_class_name: str

Returns a formatted string of the class name for logging purposes.

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

Handle GET requests and return a cleaned HttpResponse.

Parameters:

request (ASGIRequest) – The HTTP request object.

Returns:

An HttpResponse with the cleaned HTML content.

Return type:

HttpResponse

guardrails: list[Guardrail]
template_path: str = 'react/guardrail-list.html'