pipelines.views module#
- class pipelines.views.IsStaffRequiredMixin#
Bases:
AccessMixinVerify that the current user is_staff.
If the user is not staff the view will return the result of
handle_no_permissionotherwise the views usualdispatchmethod will be called.- dispatch(request, *args, **kwargs)#
- class pipelines.views.LogFilterView(**kwargs)#
Bases:
IsStaffRequiredMixin,TemplateViewView that updates the htmx log view to include filter parameters.
filtershould be applied as a query parameter. The value should be the the type and id of the object to fetch logs for. For examplefilter=PipelineResult-1will filter log by thePipelineResultwith id 1.- Parameters:
run_id – The id of the run to view.
- get_context_data(**kwargs)#
- property log_url#
- template_name = 'pipelines/_log_filter.html'#
- class pipelines.views.LogListView(**kwargs)#
Bases:
IsStaffRequiredMixin,TemplateViewView to return the rendered logs for the selected context item. . This is intended to be polled by htmx to render the results list content.
The logs can be filtered by passing 2 query string parameters:
type: One of “PipelineResult”, “TaskExecution” or “TaskResult”.id: The id of the object in the results storage.
It will return with a status code of 200 unless the pipeline execution has complete at which point it will resturn with a status code of 286 instructing htmx to stop polling.
- Parameters:
run_id – The id of the run to view.
- all_tasks_completed()#
- get(request, *args, **kwargs)#
- get_context_data(**kwargs)#
- get_logs(run_id)#
- pipeline_execution#
- template_name = 'pipelines/_log_list.html'#
- class pipelines.views.PipelineExecutionListView(**kwargs)#
Bases:
IsStaffRequiredMixin,ListViewRenders a list of all ``PipelineExecution``s for a given pipeline.
- Params slug:
The id of the pipeline to fetch executions for.
- get_context_data(**kwargs)#
Get the context for this view.
- get_queryset()#
Return the list of items for this view.
The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.
- paginate_by = 30#
- template_name = 'pipelines/pipeline_execution_list.html'#
- class pipelines.views.PipelineListView(**kwargs)#
Bases:
IsStaffRequiredMixin,TemplateViewRenders a list of all registered pipelines along with their running stats.
- get_context_data(**kwargs)#
- template_name = 'pipelines/pipeline_list.html'#
- class pipelines.views.PipelineResultView(**kwargs)#
Bases:
IsStaffRequiredMixin,TemplateViewShows the results for a given pipeline run.
- Parameters:
run_id – The id of the run to view.
- template_name = 'pipelines/results_list.html'#
- class pipelines.views.PipelineStartView(**kwargs)#
Bases:
IsStaffRequiredMixin,FormViewRenders a form to start a pipeline running. If there is any input data required by any of the tasks, a form will be rendered to allow the user to pass values to the pipeline.
- Params slug:
The id of the pipeline to fetch executions for.
- form_class#
alias of
PipelineStartForm
- form_valid(form)#
If the form is valid, redirect to the supplied URL.
- get_context_data(**kwargs)#
Insert the form into the context dict.
- get_form_kwargs()#
Return the keyword arguments for instantiating the form.
- get_success_url(*args, **kwargs)#
Return the URL to redirect to after processing a valid form.
- template_name = 'pipelines/pipeline_start.html'#
- class pipelines.views.TaskResultListView(**kwargs)#
Bases:
IsStaffRequiredMixin,ListViewView to return the rendered task results view. This is intended to be polled by htmx to render the results list content.
It will return with a status code of 200 unless the pipeline execution has complete at which point it will resturn with a status code of 286 instructing htmx to stop polling.
- Parameters:
run_id – The id of the run to view.
- all_tasks_completed()#
- get(request, *args, **kwargs)#
- get_queryset()#
Return the list of items for this view.
The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.
- pipeline_execution#
- template_name = 'pipelines/_results_list.html'#
- class pipelines.views.TaskResultReRunView(**kwargs)#
Bases:
IsStaffRequiredMixin,RedirectViewView to rerun a specific task.
- Parameters:
pk – The id of the task result to rerun.
- get(request, *args, **kwargs)#
- get_object(queryset=None)#
- get_redirect_url(*args, **kwargs)#
Return the URL redirect to. Keyword arguments from the URL pattern match generating the redirect request are provided as kwargs to this method.