views

Define Django views for the taskmanager app.

class eztaskmanager.views.LogViewerView(**kwargs)[source]

Class LogViewerView displays a log viewer page with log information for a specific report.

template_name = 'log_viewer.html'
static get_report_lines(report)[source]

Return the log lines for this report.

get_context_data(**kwargs)[source]

Return the context data for the view.

class eztaskmanager.views.LiveLogViewerView(**kwargs)[source]

A template view to view the rolling report log.

template_name = 'live_log_viewer.html'
get_context_data(**kwargs)[source]

Return the context data for the view, removing the offset file, to allow reading log lines from the start.

class eztaskmanager.views.AjaxReadLogLines(**kwargs)[source]

Read log lines starting from an offset, as JsonResponse.

New log size and task status are included in the response.

render_to_response(context, **response_kwargs)[source]

Render a response with JSON data.

Parameters:
  • self – The instance of the class calling the method.

  • context (dict) – A dictionary containing the context data.

  • **response_kwargs – Additional keyword arguments used for the response.

Returns:

A response object with JSON data containing the following keys:
  • new_log_lines (list): List of log lines.

  • task_status (str): The status of the task.

  • log_size (int): The size of the log.

Return type:

JsonResponse

Raises:

None.