Views#
- class tom_dataproducts.views.DataProductDeleteView(**kwargs)[source]#
View that handles the deletion of a
DataProduct. Requires authentication.- check_permissions(request)[source]#
Checks if request.user has all permissions returned by get_required_permissions method.
- Parameters:
request – Original request.
- form_valid(form)[source]#
Method that handles DELETE requests for this view. It performs the following actions in order: 1. Deletes all
ReducedDatumobjects associated with theDataProduct. 2. Deletes the file referenced by theDataProduct. 3. Deletes theDataProductobject from the database.- Parameters:
form (django.forms.Form) – Django form instance containing the data for the DELETE request.
- Returns:
HttpResponseRedirect to the success URL.
- Return type:
HttpResponseRedirect
- get_context_data(*args, **kwargs)[source]#
Adds the referer to the query parameters as “next” and returns the context dictionary.
- Returns:
context dictionary
- Return type:
dict
- get_required_permissions(request=None)[source]#
Returns list of permissions in format <app_label>.<codename> that should be checked against request.user and object. By default, it returns list from
permission_requiredattribute.- Parameters:
request – Original request.
- get_success_url()[source]#
Gets the URL specified in the query params by “next” if it exists, otherwise returns the URL for home.
- Returns:
referer or the index URL
- Return type:
str
- model#
alias of
DataProduct
- class tom_dataproducts.views.DataProductFeatureView(**kwargs)[source]#
View that handles the featuring of
DataProduct``s. A featured ``DataProductis displayed on theTargetDetailView.
- class tom_dataproducts.views.DataProductGroupCreateView(**kwargs)[source]#
View that handles the creation of a new
DataProductGroup.- model#
alias of
DataProductGroup
- class tom_dataproducts.views.DataProductGroupDataView(**kwargs)[source]#
View that handles the addition of
DataProduct``s to a ``DataProductGroup. Requires authentication.- form_class#
alias of
AddProductToGroupForm
- class tom_dataproducts.views.DataProductGroupDeleteView(**kwargs)[source]#
View that handles the deletion of a
DataProductGroup. Requires authentication.- model#
alias of
DataProductGroup
- class tom_dataproducts.views.DataProductGroupDetailView(**kwargs)[source]#
View that handles the viewing of a specific
DataProductGroup.- model#
alias of
DataProductGroup
- class tom_dataproducts.views.DataProductGroupListView(**kwargs)[source]#
View that handles the display of all
DataProductGroupobjects.- model#
alias of
DataProductGroup
- class tom_dataproducts.views.DataProductListView(**kwargs)[source]#
View that handles the list of
DataProductobjects.- filterset_class#
alias of
DataProductFilter
- get_context_data(*args, **kwargs)[source]#
Adds the set of
DataProductGroupobjects to the context dictionary.- Returns:
context dictionary
- Return type:
dict
- get_queryset()[source]#
Gets the set of
DataProductobjects that the user has permission to view.- Returns:
Set of
DataProductobjects- Return type:
QuerySet
- model#
alias of
DataProduct
- class tom_dataproducts.views.DataProductSaveView(**kwargs)[source]#
View that handles saving a
DataProductgenerated by an observation. Requires authentication.- post(request, *args, **kwargs)[source]#
Method that handles POST requests for the
DataProductSaveView. Gets the observation facility that created the data and saves the selected data products asDataProductobjects. Redirects to theObservationDetailViewfor the specificObservationRecord.- Parameters:
request (HttpRequest) – Django POST request object
- class tom_dataproducts.views.DataProductUploadView(**kwargs)[source]#
View that handles manual upload of DataProducts. Requires authentication.
- form_class#
alias of
DataProductUploadForm
- form_invalid(form)[source]#
Adds errors to Django messaging framework in the case of an invalid form and redirects to the previous page.
View that handles the sharing of data with another TOM.
alias of
DataShareForm
Adds errors to Django messaging framework in the case of an invalid form and redirects to the previous page.
Return an instance of the form to be used in this view.
Method that handles the POST requests for sharing data. Handles Data Products and All the data of a type for a target as well as individual Reduced Datums. Share with TOM.
- class tom_dataproducts.views.SingleTargetDataServiceQueryView(**kwargs)[source]#
View that handles queries for single target data services
- class tom_dataproducts.views.UpdateReducedDataView(**kwargs)[source]#
View that handles the updating of reduced data tied to a
DataProductthat was ingested from a dataservice. The ReducedDatum.source must match the DataService.name Requires authentication.