ListView

This module contains views to implement the React AuthToken list view in the Smarter Dashboard.

class smarter.lib.drf.views.listview.view.AuthTokenListView(*args, **kwargs)[source]

Bases: SmarterAuthenticatedNeverCachedWebView

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

This view displays all authtokens available to the authenticated user as cards, providing a quick overview and access to authtoken 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 authtoken, or a 404 error page if the user is not authenticated.

Return type:

HttpResponse

authtokens: list[SmarterAuthToken]
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

template_path: str = 'react/authtoken-list.html'