tardis.tardis_portal.views package

Submodules

tardis.tardis_portal.views.ajax_actions module

views that perform some action and don’t return anything very useful

tardis.tardis_portal.views.ajax_json module

views that return JSON data

tardis.tardis_portal.views.ajax_json.retrieve_licenses(request)

tardis.tardis_portal.views.ajax_pages module

views that return HTML that is injected into pages

tardis.tardis_portal.views.ajax_pages.experiment_public_access_badge(request, experiment_id)
tardis.tardis_portal.views.ajax_pages.retrieve_owned_exps_list(request, *args, **kwargs)
tardis.tardis_portal.views.ajax_pages.retrieve_shared_exps_list(request, *args, **kwargs)

tardis.tardis_portal.views.authentication module

views that have to do with authentication

tardis.tardis_portal.views.authentication.create_user(request, *args, **kwargs)
tardis.tardis_portal.views.authentication.login(request, *args, **kwargs)

handler for login page

tardis.tardis_portal.views.authentication.logout(request)
tardis.tardis_portal.views.authentication.manage_auth_methods(request, *args, **kwargs)

Manage the user’s authentication methods using AJAX.

tardis.tardis_portal.views.authentication.manage_user_account(request, *args, **kwargs)
tardis.tardis_portal.views.authentication.rcauth(*args, **kwargs)

tardis.tardis_portal.views.authorisation module

views that have to do with authorisations

tardis.tardis_portal.views.authorisation.create_group(*args, **kwargs)
tardis.tardis_portal.views.authorisation.manage_groups(request, *args, **kwargs)
tardis.tardis_portal.views.authorisation.retrieve_access_list_group_readonly(request, *args, **kwargs)
tardis.tardis_portal.views.authorisation.retrieve_access_list_user_readonly(request, *args, **kwargs)
tardis.tardis_portal.views.authorisation.retrieve_group_list(request, *args, **kwargs)
tardis.tardis_portal.views.authorisation.retrieve_group_list_by_user(request, *args, **kwargs)
tardis.tardis_portal.views.authorisation.retrieve_group_userlist_readonly(request, *args, **kwargs)
tardis.tardis_portal.views.authorisation.retrieve_user_list(request, *args, **kwargs)
tardis.tardis_portal.views.authorisation.share(request, experiment_id)

Choose access rights and licence.

tardis.tardis_portal.views.authorisation.token_delete(request, *args, **kwargs)

tardis.tardis_portal.views.facilities module

views relevant for facilities and the facility view

tardis.tardis_portal.views.facilities.dataset_aggregate_info(dataset)
tardis.tardis_portal.views.facilities.datetime_to_us(dt)

The datetime objects are kept as None if they aren’t set, otherwise they’re converted to milliseconds so AngularJS can format them nicely.

tardis.tardis_portal.views.facilities.facility_overview_data_count(request, *args, **kwargs)

returns the total number of datasets for pagination in json format

tardis.tardis_portal.views.facilities.facility_overview_datafile_list(dataset)
tardis.tardis_portal.views.facilities.facility_overview_dataset_detail(request, *args, **kwargs)
tardis.tardis_portal.views.facilities.facility_overview_experiments(request, *args, **kwargs)

json facility datasets

tardis.tardis_portal.views.facilities.facility_overview_facilities_list(request, *args, **kwargs)

json list of facilities managed by the current user

tardis.tardis_portal.views.images module

views that return images or route to images

tardis.tardis_portal.views.images.load_datafile_image(request, parameter_id)
tardis.tardis_portal.views.images.load_dataset_image(request, parameter_id)
tardis.tardis_portal.views.images.load_experiment_image(request, parameter_id)
tardis.tardis_portal.views.images.load_image(request, *args, **kwargs)

tardis.tardis_portal.views.machine module

views that return data useful only to other machines (but not JSON)

tardis.tardis_portal.views.machine.site_settings(request)

tardis.tardis_portal.views.pages module

views that render full pages

class tardis.tardis_portal.views.pages.DatasetView(**kwargs)

Bases: django.views.generic.base.TemplateView

find_custom_view_override(request, dataset)

Determines if any custom view overrides have been defined in settings.DATASET_VIEWS and returns the view function if a match to one the schemas for the dataset is found. (DATASET_VIEWS is a list of (schema_namespace, view_function) tuples).

Parameters:
  • request
  • dataset
Returns:

Return type:

get(request, *args, **kwargs)

View an existing dataset.

This default view can be overriden by defining a dictionary DATASET_VIEWS in settings.

Parameters:
Returns:

The Django response object

Return type:

django.http.HttpResponse

get_context_data(request, dataset, **kwargs)

Prepares the values to be passed to the default dataset view, respecting authorization rules. Returns a dict of values (the context).

Parameters:
Returns:

A dictionary of values for the view/template.

Return type:

dict

template_name = 'tardis_portal/view_dataset.html'
class tardis.tardis_portal.views.pages.ExperimentView(**kwargs)

Bases: django.views.generic.base.TemplateView

find_custom_view_override(request, experiment)
get(request, *args, **kwargs)

View an existing experiment.

This default view can be overriden by defining a dictionary EXPERIMENT_VIEWS in settings.

Parameters:
  • request (django.http.HttpRequest) – a HTTP Request instance
  • args (list) –
  • kwargs (dict) – In kwargs: param int experiment_id: the ID of the experiment
Returns:

an HttpResponse

Return type:

django.http.HttpResponse

get_context_data(request, experiment, **kwargs)

Prepares the values to be passed to the default experiment view, respecting authorization rules. Returns a dict of values (the context).

Parameters:
Returns:

A dictionary of values for the view/template.

Return type:

dict

template_name = 'tardis_portal/view_experiment.html'
class tardis.tardis_portal.views.pages.IndexView(**kwargs)

Bases: django.views.generic.base.TemplateView

get(request, *args, **kwargs)

The index view, intended to render the front page of the MyTardis site listing recent experiments.

This default view can be overriden by defining a dictionary INDEX_VIEWS in settings which maps SITE_ID’s or domain names to an alternative view function (similar to the DATASET_VIEWS or EXPERIMENT_VIEWS overrides).

Parameters:
Returns:

The Django response object

Return type:

django.http.HttpResponse

get_context_data(*args, **kwargs)
template_name = 'tardis_portal/index.html'
tardis.tardis_portal.views.pages.about(request)
tardis.tardis_portal.views.pages.add_dataset(request, *args, **kwargs)
tardis.tardis_portal.views.pages.control_panel(request, *args, **kwargs)
tardis.tardis_portal.views.pages.create_experiment(request, *args, **kwargs)

Create a new experiment view.

Parameters:
  • request (django.http.HttpRequest) – a HTTP Request instance
  • template_name (string) – the path of the template to render
Returns:

an HttpResponse

Return type:

django.http.HttpResponse

tardis.tardis_portal.views.pages.edit_dataset(request, *args, **kwargs)
tardis.tardis_portal.views.pages.facility_overview(request, *args, **kwargs)

summary of experiments in a facility

tardis.tardis_portal.views.pages.my_data(request, *args, **kwargs)

show owned data with credential-based access

tardis.tardis_portal.views.pages.public_data(request)

list of public experiments

tardis.tardis_portal.views.pages.shared(request, *args, **kwargs)

show shared data with credential-based access

tardis.tardis_portal.views.pages.site_routed_view(request, _default_view, _site_mappings, *args, **kwargs)

Allows a view to be overriden based on the Site (eg domain) for the current request. Takes a default fallback view (_default_view) and a dictionary mapping Django Sites (domain name or int SITE_ID) to views. If the current request matches a Site in the dictionary, that view is used instead of the default.

The intention is to define {site: view} mappings in settings.py, and use this wrapper view in urls.py to allow a single URL to be routed to different views depending on the Site in the request.

Parameters:
  • request (django.http.HttpRequest) – a HTTP request object
  • _default_view (types.FunctionType | str) – The default view if no Site in _site_mappings matches the current Site.
  • _site_mappings (dict) – A dictionary mapping Django sites to views (sites are specified as either a domain name str or int SITE_ID).
  • args
  • kwargs
Returns:

A view function

Return type:

types.FunctionType

tardis.tardis_portal.views.pages.stats(request, *args, **kwargs)
tardis.tardis_portal.views.pages.use_rapid_connect(fn)

A decorator that adds AAF Rapid Connect settings to a get_context_data method.

Parameters:fn (types.FunctionType) – A get_context_data function/method.
Returns:A get_context_data function that adds RAPID_CONNECT_* keys to its output context.
Return type:types.FunctionType
tardis.tardis_portal.views.pages.user_guide(request)

tardis.tardis_portal.views.parameters module

views to do with metadata, parameters etc. Mostly ajax page inclusions

tardis.tardis_portal.views.parameters.add_datafile_par(request, *args, **kwargs)
tardis.tardis_portal.views.parameters.add_dataset_par(request, *args, **kwargs)
tardis.tardis_portal.views.parameters.add_experiment_par(request, *args, **kwargs)
tardis.tardis_portal.views.parameters.add_par(request, parentObject, otype, stype)
tardis.tardis_portal.views.parameters.edit_datafile_par(request, *args, **kwargs)
tardis.tardis_portal.views.parameters.edit_dataset_par(request, *args, **kwargs)
tardis.tardis_portal.views.parameters.edit_experiment_par(request, *args, **kwargs)
tardis.tardis_portal.views.parameters.edit_parameters(request, parameterset, otype)

tardis.tardis_portal.views.upload module

views for uploading files via HTTP

tardis.tardis_portal.views.upload.upload_complete(request, template_name='tardis_portal/upload_complete.html')

The ajax-loaded result of a file being uploaded

Parameters:
  • request (django.http.HttpRequest) – a HTTP Request instance
  • template_name (string) – the path of the template to render
Returns:

an HttpResponse

Return type:

django.http.HttpResponse

tardis.tardis_portal.views.utils module

helper functions used by other views

class tardis.tardis_portal.views.utils.HttpResponseMethodNotAllowed(*args, **kwargs)

Bases: django.http.response.HttpResponse

status_code = 303
class tardis.tardis_portal.views.utils.HttpResponseSeeAlso(redirect_to, *args, **kwargs)

Bases: django.http.response.HttpResponseRedirect

status_code = 303
tardis.tardis_portal.views.utils.feedback(request)
tardis.tardis_portal.views.utils.get_dataset_info(dataset, include_thumbnail=False, exclude=None)
tardis.tardis_portal.views.utils.remove_csrf_token(request)

rather than fixing the form code that loops over all POST entries indiscriminately, I am removing the csrf token with this hack. This is only required in certain form code and can be removed should this ever be fixed

Module contents

importing all views files here, so that any old code will work as expected, when importing from tardis.tardis_portal.views