Views

class tom_dataservices.views.DataServiceQueryFilterSet(data=None, queryset=None, *, request=None, prefix=None)

Defines the available fields for filtering the list of queries.

class tom_dataservices.views.DataServiceQueryListView(**kwargs)

View that displays all saved DataServiceQuery objects.

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

model

alias of DataServiceQuery

filterset_class

alias of DataServiceQueryFilterSet

get_context_data(*args, **kwargs)

Adds the data services available to the TOM to the context dictionary.

Returns:

context

Return type:

dict

class tom_dataservices.views.DataServiceQueryCreateView(**kwargs)

View for creating a new query to a data service. Requires authentication.

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

get_data_service_name()

Returns the data service specified in the request

Returns:

DataService name

Return type:

str

get_form_class()

Returns the form class to use in this view. The form class will be the one defined in the specific dataservice module for which a new query is being created.

get_form(form_class=None)

Returns an instance of the form to be used in this view.

Returns:

Form instance

Return type:

django.forms.Form

get_initial()

Returns the initial data to use for forms on this view.

Returns:

dict of initial values

Return type:

dict

form_valid(form)

Saves the associated DataServiceQuery and redirects to the DataServiceQuery list.

get_context_data(*args, **kwargs)

Adds any form partials to the context.

Returns:

context

Return type:

dict

class tom_dataservices.views.RunQueryView(**kwargs)

View that handles the running of a query that was either submitted via the form or saved as a DataServiceQuery.

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

get_context_data(*args, **kwargs)

Collects the query parameters from either a saved DataServiceQuery or from the session data, runs the query, and returns the results as context for the list template.

Returns:

context

Return type:

dict

class tom_dataservices.views.DataServiceQueryDeleteView(**kwargs)

View that handles the deletion of a saved DataServiceQuery. Requires authentication.

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

model

alias of DataServiceQuery

class tom_dataservices.views.DataServiceQueryUpdateView(**kwargs)

View that handles the modification of a previously saved DataServiceQuery. Requires authentication.

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

get_object()

Returns the DataServiceQuery object that corresponds with the ID in the query path.

Returns:

DataServiceQuery object

Return type:

DataServiceQuery

get_form_class()

Returns the form class to use in this view. The form class will be the one defined in the specific data service module for which the query is being updated.

get_form(form_class=None)

Returns an instance of the form to be used in this view.

Returns:

Form instance

Return type:

django.forms.Form

get_initial()

Returns the initial data to use for forms on this view. Initial data for this form consists of the name of the Data Service that the query is for and the saved query parameters.

Returns:

dict of initial values

Return type:

dict

form_valid(form)

Saves the associated DataServiceQuery if requested and redirects to the DataServiceQuery list.

get_context_data(*args, **kwargs)

Adds any form partials to the context.

Returns:

context

Return type:

dict

class tom_dataservices.views.CreateTargetFromQueryView(**kwargs)

View that handles the creation of Target objects from a Data Service Query result. Requires authentication.

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

post(request, *args, **kwargs)

Handles the POST requests to this view. Creates a Target for each query result sent in the POST. Redirects to the TargetListView if multiple targets were created, and the TargetUpdateView if only one was created. Redirects to the RunQueryView if no Target objects were successfully created.