tardis.tardis_portal.models package

Submodules

tardis.tardis_portal.models.access_control module

class tardis.tardis_portal.models.access_control.GroupAdmin(*args, **kwargs)

Bases: django.db.models.base.Model

GroupAdmin links the Django User and Group tables for group administrators

Attribute user:a forign key to the django.contrib.auth.models.User
Attribute group:
 a forign key to the django.contrib.auth.models.Group
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

group
objects = <django.db.models.manager.Manager object>
user
class tardis.tardis_portal.models.access_control.ObjectACL(*args, **kwargs)

Bases: django.db.models.base.Model

The ObjectACL (formerly ExperimentACL) table is the core of the Tardis Authorisation framework

Attribute pluginId:
 the the name of the auth plugin being used
Attribute entityId:
 a foreign key to auth plugins
Attribute object_type:
 a foreign key to ContentType
Attribute object_id:
 the primary key/id of the object_type
Attribute canRead:
 gives the user read access
Attribute canWrite:
 gives the user write access
Attribute canDelete:
 gives the user delete permission
Attribute isOwner:
 the experiment owner flag.
Attribute effectiveDate:
 the date when access takes into effect
Attribute expiryDate:
 the date when access ceases
Attribute aclOwnershipType:
 system-owned or user-owned.

System-owned ACLs will prevent users from removing or editing ACL entries to a particular experiment they own. User-owned ACLs will allow experiment owners to remove/add/edit ACL entries to the experiments they own.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

OWNER_OWNED = 1
SYSTEM_OWNED = 2
content_object

Provides a generic relation to any object through content-type/object-id fields.

content_type
get_aclOwnershipType_display(*moreargs, **morekwargs)
classmethod get_effective_query()

If possible, resolve the pluginId/entityId combination to a user or group object.

If possible, resolve the pluginId/entityId combination to a user or group object.

objects = <django.db.models.manager.Manager object>
class tardis.tardis_portal.models.access_control.UserAuthentication(id, userProfile, username, authenticationMethod)

Bases: django.db.models.base.Model

CHOICES = ()
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

getAuthMethodDescription()
objects = <django.db.models.manager.Manager object>
userProfile
class tardis.tardis_portal.models.access_control.UserProfile(*args, **kwargs)

Bases: django.db.models.base.Model

UserProfile class is an extension to the Django standard user model.

Attribute isDjangoAccount:
 is the user a local DB user
Attribute user:a foreign key to the django.contrib.auth.models.User
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ext_groups
getUserAuthentications()
isValidPublicContact()

Checks if there’s enough information on the user for it to be used as a public contact.

Note: Last name can’t be required, because people don’t necessarilly have a last (or family) name.

objects = <django.db.models.manager.Manager object>
user
userauthentication_set
tardis.tardis_portal.models.access_control.create_user_api_key(sender, **kwargs)

Auto-create ApiKey objects using Tastypie’s create_api_key

tardis.tardis_portal.models.access_control.create_user_profile(sender, instance, created, **kwargs)

tardis.tardis_portal.models.datafile module

class tardis.tardis_portal.models.datafile.DataFile(*args, **kwargs)

Bases: django.db.models.base.Model

Class to store meta-data about a file. The physical copies of a file are described by distinct DataFileObject instances.

Attribute dataset:
 the foreign key to the tardis.tardis_portal.models.Dataset the file belongs to.
Attribute filename:
 the name of the file, excluding the path.
Attribute size:the size of the file.
Attribute created_time:
 time the file was added to tardis
Attribute modification_time:
 last modification time of the file
Attribute mimetype:
 for example ‘application/pdf’
Attribute md5sum:
 digest of length 32, containing only hexadecimal digits
Attribute sha512sum:
 digest of length 128, containing only hexadecimal digits
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

cache_file()
datafileparameterset_set
dataset
file_object
file_objects
getParameterSets(schemaType=None)

Return datafile parametersets associated with this datafile.

get_absolute_filepath()
get_as_temporary_file(*args, **kwds)

Returns a traditional file-system-based file object that is a copy of the original data. The file is deleted when the context is destroyed. :param directory: the directory in which to create the temp file :return: the temporary file object

get_default_storage_box()

try to guess appropriate box from files, dataset or experiment

get_download_url()
get_file(verified_only=True)

Returns the file as a readable file-like object from the best avaiable storage box.

If verified_only=False, the return of files without a verified checksum is allowed, otherwise None is returned for unverified files.

Return type:Python File object
get_image_data()
get_mimetype()
get_preferred_dfo(verified_only=True)
get_receiving_storage_box()
get_size()
get_view_url()
has_image()
is_image()

returns True if it’s an image and not an x-icon and not an img the image/img mimetype is made up though and may need revisiting if there is an official img mimetype that does not refer to diffraction images

is_local()
is_online

return False if a file is on tape. At this stage it checks it returns true for no file objects, because those files are offline through other checks

is_public()
objects = <django.db.models.manager.Manager object>
save(*args, **kwargs)
status

returns information about the status of the file. States are defined in StorageBox

classmethod sum_sizes(datafiles)

Takes a query set of datafiles and returns their total size.

update_mimetype(mimetype=None, force=False, save=True)
verified
verify(reverify=False)
class tardis.tardis_portal.models.datafile.DataFileObject(*args, **kwargs)

Bases: django.db.models.base.Model

holds one copy of the data for a datafile

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

cache_file()
copy_file(dest_box=None, verify=True)

copies verified file to new storage box checks for existing copy triggers async verification if not disabled :param dest_box: StorageBox instance :param verify: bool

create_set_uri(force=False, save=False)

sets the uri as well as building it :param force: :return:

datafile
delete_data()
file_object

A set of accessor functions that convert the file information to a standard Python file object for reading and copy the contents of an existing file_object into the storage backend.

Return type:Python File object
get_full_path()
get_next_by_created_time(*moreargs, **morekwargs)
get_previous_by_created_time(*moreargs, **morekwargs)
modified_time
move_file(dest_box=None)

moves a file copies first, then synchronously verifies deletes file if copy is true copy and has been verified

Parameters:dest_box – StorageBox instance
objects = <django.db.models.manager.Manager object>
save(*args, **kwargs)
storage_box
storage_type
Returns:storage_box type
Return type:StorageBox type constant
verify(add_checksums=True, add_size=True)
tardis.tardis_portal.models.datafile.compute_checksums(file_object, compute_md5=True, compute_sha512=True, close_file=True)

Computes checksums for a python file object

Parameters:
  • file_object – Python File object
  • compute_md5 (bool) – whether to compute md5 default=True
  • compute_sha512 (bool) – whether to compute sha512, default=True
  • close_file – whether to close the file_object, default=True
Returns:

the checksums as {‘md5sum’: result, ‘sha512sum’: result}

:rtype : dict

tardis.tardis_portal.models.datafile.delete_dfo(sender, instance, **kwargs)

tardis.tardis_portal.models.dataset module

class tardis.tardis_portal.models.dataset.Dataset(*args, **kwargs)

Bases: django.db.models.base.Model

Class to link datasets to experiments

Attribute experiment:
 a forign key to the tardis.tardis_portal.models.Experiment
Attribute facility:
 the foreign key to the facility that generated this data
Attribute instrument:
 the foreign key to the instrument that generated this data
Attribute description:
 description of this dataset
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

datafile_set
datasetparameterset_set
equipment_set
experiments
getParameterSets(schemaType=None)

Return the dataset parametersets associated with this experiment.

get_absolute_url(*args, **kwargs)

Return the absolute url to the current Dataset

get_all_storage_boxes_used()
get_download_urls()
get_edit_url(*args, **kwargs)

Return the absolute url to the edit view of the current Dataset

get_first_experiment()
get_images()
get_path()
get_size()
get_thumbnail_url()
image
instrument
is_online
objects = <tardis.tardis_portal.managers.OracleSafeManager object>

tardis.tardis_portal.models.experiment module

class tardis.tardis_portal.models.experiment.Experiment(*args, **kwargs)

Bases: django.db.models.base.Model

The Experiment model inherits from django.db.models.Model

Attribute url:Undocumented
Attribute approved:
 Undocumented
Attribute title:
 the title of the experiment.
Attribute institution_name:
 the name of the institution who created the dataset.
Attribute start_time:
 Undocumented
Attribute end_time:
 Undocumented
Attribute created_time:
 Undocumented
Attribute handle:
 Undocumented
Attribute public:
 Undocumented
Attribute objects:
 default model manager
Attribute safe:ACL aware model manager
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

PUBLICATION_DETAILS_SCHEMA = 'http://www.tardis.edu.au/schemas/publication/details/'
PUBLICATION_DRAFT_SCHEMA = 'http://www.tardis.edu.au/schemas/publication/draft/'
PUBLICATION_SCHEMA_ROOT = 'http://www.tardis.edu.au/schemas/publication/'
PUBLIC_ACCESS_CHOICES = ((1, 'No public access (hidden)'), (25, 'Ready to be released pending embargo expiry'), (50, 'Public Metadata only (no data file access)'), (100, 'Public'))
PUBLIC_ACCESS_EMBARGO = 25
PUBLIC_ACCESS_FULL = 100
PUBLIC_ACCESS_METADATA = 50
PUBLIC_ACCESS_NONE = 1
created_by
datasets
experimentauthor_set
experimentparameterset_set
getParameterSets(schemaType=None)

Return the experiment parametersets associated with this experiment.

get_absolute_url(*args, **kwargs)

Return the absolute url to the current Experiment

get_create_token_url(*args, **kwargs)

Return the absolute url to the create token view of the current Experiment

get_ct()
get_datafiles()
get_download_urls()
get_edit_url(*args, **kwargs)

Return the absolute url to the edit view of the current Experiment

get_groups()
get_images()
get_next_by_created_time(*moreargs, **morekwargs)
get_next_by_update_time(*moreargs, **morekwargs)
get_or_create_directory()
get_owners()
get_previous_by_created_time(*moreargs, **morekwargs)
get_previous_by_update_time(*moreargs, **morekwargs)
get_public_access_display(*moreargs, **morekwargs)
get_size()
is_publication()
is_publication_draft()
license
objectacls

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

objects = <tardis.tardis_portal.managers.OracleSafeManager object>
classmethod public_access_implies_distribution(public_access_level)

Determines if a level of public access implies that distribution should be allowed, or alternately if it should not be allowed. Used to prevent free-distribution licences for essentially private data, and overly-restrictive licences for public data.

public_download_allowed()

instance method version of ‘public_access_implies_distribution’

safe = <tardis.tardis_portal.managers.ExperimentManager object>
save(*args, **kwargs)
token_set
class tardis.tardis_portal.models.experiment.ExperimentAuthor(id, experiment, author, institution, email, order, url)

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

experiment
objects = <django.db.models.manager.Manager object>
save(*args, **kwargs)

tardis.tardis_portal.models.facility module

class tardis.tardis_portal.models.facility.Facility(*args, **kwargs)

Bases: django.db.models.base.Model

Represents a facility that produces data

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

instrument_set
manager_group
objects = <django.db.models.manager.Manager object>
tardis.tardis_portal.models.facility.facilities_managed_by(user)

Returns a list of facilities managed by a user

tardis.tardis_portal.models.facility.is_facility_manager(user)

Returns true if the user manages one or more facilities

tardis.tardis_portal.models.hooks module

tardis.tardis_portal.models.hooks.ensure_doi_exists(sender, **kwargs)
tardis.tardis_portal.models.hooks.post_save_experiment(sender, **kwargs)
tardis.tardis_portal.models.hooks.post_save_experiment_parameter(sender, **kwargs)
tardis.tardis_portal.models.hooks.post_save_experimentauthor(sender, **kwargs)
tardis.tardis_portal.models.hooks.publish_public_expt_rifcs(experiment)

tardis.tardis_portal.models.instrument module

class tardis.tardis_portal.models.instrument.Instrument(*args, **kwargs)

Bases: django.db.models.base.Model

Represents an instrument belonging to a facility that produces data

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

dataset_set
facility
getParameterSets(schemaType=None)

Return the instrument parametersets associated with this instrument.

instrumentparameterset_set
objects = <django.db.models.manager.Manager object>

tardis.tardis_portal.models.jti module

class tardis.tardis_portal.models.jti.JTI(id, jti, created_time)

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

get_next_by_created_time(*moreargs, **morekwargs)
get_previous_by_created_time(*moreargs, **morekwargs)
objects = <django.db.models.manager.Manager object>

tardis.tardis_portal.models.license module

class tardis.tardis_portal.models.license.License(*args, **kwargs)

Bases: django.db.models.base.Model

Represents a licence for experiment content.

Instances should provide enough detail for both researchers to select the licence, and for the users of their data to divine correct usage of experiment content.

(Non-US developers: We’re using US spelling in the code.)

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

experiment_set
classmethod get_none_option_license()
classmethod get_suitable_licenses(public_access_method=None)
objects = <django.db.models.manager.Manager object>

tardis.tardis_portal.models.parameters module

class tardis.tardis_portal.models.parameters.DatafileParameter(id, name, string_value, numerical_value, datetime_value, link_id, link_ct, parameterset)

Bases: tardis.tardis_portal.models.parameters.Parameter

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Provides a generic relation to any object through content-type/object-id fields.

name
objects = <tardis.tardis_portal.managers.OracleSafeManager object>
parameter_type = 'Datafile'
parameterset
class tardis.tardis_portal.models.parameters.DatafileParameterSet(id, schema, datafile)

Bases: tardis.tardis_portal.models.parameters.ParameterSet

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

datafile
datafileparameter_set
objects = <django.db.models.manager.Manager object>
parameter_class

alias of DatafileParameter

schema
storage_box
class tardis.tardis_portal.models.parameters.DatasetParameter(id, name, string_value, numerical_value, datetime_value, link_id, link_ct, parameterset)

Bases: tardis.tardis_portal.models.parameters.Parameter

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Provides a generic relation to any object through content-type/object-id fields.

name
objects = <tardis.tardis_portal.managers.OracleSafeManager object>
parameter_type = 'Dataset'
parameterset
class tardis.tardis_portal.models.parameters.DatasetParameterSet(id, schema, dataset)

Bases: tardis.tardis_portal.models.parameters.ParameterSet

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

dataset
datasetparameter_set
objects = <django.db.models.manager.Manager object>
parameter_class

alias of DatasetParameter

schema
storage_box
class tardis.tardis_portal.models.parameters.ExperimentParameter(id, name, string_value, numerical_value, datetime_value, link_id, link_ct, parameterset)

Bases: tardis.tardis_portal.models.parameters.Parameter

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Provides a generic relation to any object through content-type/object-id fields.

name
objects = <tardis.tardis_portal.managers.OracleSafeManager object>
parameter_type = 'Experiment'
parameterset
save(*args, **kwargs)
class tardis.tardis_portal.models.parameters.ExperimentParameterSet(id, schema, experiment)

Bases: tardis.tardis_portal.models.parameters.ParameterSet

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

experiment
experimentparameter_set
objects = <django.db.models.manager.Manager object>
parameter_class

alias of ExperimentParameter

schema
storage_box
class tardis.tardis_portal.models.parameters.FreeTextSearchField(id, parameter_name)

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

objects = <django.db.models.manager.Manager object>
parameter_name
class tardis.tardis_portal.models.parameters.InstrumentParameter(id, name, string_value, numerical_value, datetime_value, link_id, link_ct, parameterset)

Bases: tardis.tardis_portal.models.parameters.Parameter

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Provides a generic relation to any object through content-type/object-id fields.

name
objects = <tardis.tardis_portal.managers.OracleSafeManager object>
parameter_type = 'Instrument'
parameterset
class tardis.tardis_portal.models.parameters.InstrumentParameterSet(id, schema, instrument)

Bases: tardis.tardis_portal.models.parameters.ParameterSet

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

instrument
instrumentparameter_set
objects = <django.db.models.manager.Manager object>
parameter_class

alias of InstrumentParameter

schema
storage_box
class tardis.tardis_portal.models.parameters.Parameter(*args, **kwargs)

Bases: django.db.models.base.Model

class Meta
abstract = False
app_label = 'tardis_portal'
ordering = ['name']
get()

Provides a generic relation to any object through content-type/object-id fields.

name
objects
parameter_type = 'Abstract'
set_value(value)

Sets the parameter value, converting into the appropriate data type. Deals with date/time strings that are timezone naive or aware, based on the USE_TZ setting.

Parameters:value – a string (or string-like) representing the value
Returns:
class tardis.tardis_portal.models.parameters.ParameterName(id, schema, name, full_name, units, data_type, immutable, comparison_type, is_searchable, choices, order)

Bases: django.db.models.base.Model

CONTAINS_COMPARISON = 8
DATETIME = 6
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

EXACT_VALUE_COMPARISON = 1
FILENAME = 5
GREATER_THAN_COMPARISON = 4
GREATER_THAN_EQUAL_COMPARISON = 5
JSON = 8
LESS_THAN_COMPARISON = 6
LESS_THAN_EQUAL_COMPARISON = 7
LONGSTRING = 7
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

NOT_EQUAL_COMPARISON = 2
NUMERIC = 1
RANGE_COMPARISON = 3
STRING = 2
URL = 3
datafileparameter_set
datasetparameter_set
experimentparameter_set
freetextsearchfield_set
getUniqueShortName()
get_comparison_type_display(*moreargs, **morekwargs)
get_data_type_display(*moreargs, **morekwargs)
instrumentparameter_set
isDateTime()
isFilename()
isLongString()
isNumeric()
isString()
isURL()
is_json()
natural_key()
objects = <tardis.tardis_portal.managers.ParameterNameManager object>
schema
class tardis.tardis_portal.models.parameters.ParameterSet(*args, **kwargs)

Bases: django.db.models.base.Model, tardis.tardis_portal.models.parameters.ParameterSetManagerMixin

class Meta
abstract = False
app_label = 'tardis_portal'
ordering = ['id']
parameter_class = None
save(*args, **kwargs)
schema
storage_box
class tardis.tardis_portal.models.parameters.ParameterSetManagerMixin(parameterset=None, parentObject=None, schema=None)

Bases: tardis.tardis_portal.ParameterSetManager.ParameterSetManager

for clarity’s sake and for future extension this class makes ParameterSetManager local to this file. At the moment its only function is increasing the line count

class tardis.tardis_portal.models.parameters.Schema(id, namespace, name, type, subtype, immutable, hidden)

Bases: django.db.models.base.Model

DATAFILE = 3
DATASET = 2
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

EXPERIMENT = 1
INSTRUMENT = 5
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

NONE = 4
exception UnsupportedType(msg)

Bases: exceptions.Exception

datafileparameterset_set
datasetparameterset_set
experimentparameterset_set
classmethod getNamespaces(type_, subtype=None)

Return the list of namespaces for equipment, sample, and experiment schemas.

classmethod getSubTypes()
classmethod get_internal_schema(schema_type)
classmethod get_schema_type_name(schema_type, short=False)
get_type_display(*moreargs, **morekwargs)
instrumentparameterset_set
natural_key()
objects = <tardis.tardis_portal.managers.SchemaManager object>
parametername_set

tardis.tardis_portal.models.storage module

class tardis.tardis_portal.models.storage.StorageBox(*args, **kwargs)

Bases: django.db.models.base.Model

table that holds storage boxes of any type. to extend to new types, add fields if necessary

Attribute max_size:
 max size in bytes
BUNDLE = 6
CACHE = 3
DISK = 1
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

TAPE = 2
TEMPORARY = 4
TYPES = {'disk': 1, 'cache': 3, 'tape': 2, 'receiving': 4, 'bundle': 6}
TYPE_UNKNOWN = 5
attributes
cache_box

Get cache box if set up

child_boxes
copy_files(dest_box=None)
copy_to_master()
classmethod create_local_box(location=None)
datafileparametersets
datasetparametersets
experimentparametersets
file_objects
classmethod get_default_storage(location=None, user=None)

gets default storage box or get local storage box with given base location or create one if it doesn’t exist.

policies: Have a StorageBoxAttribute: key=’default’, value=True find a storage box where location is DEFAULT_STORAGE_BASE_DIR create a default storage box at DEFAULT_STORAGE_BASE_DIR lowest id storage box is default no storage box defined, use hard coded default for now TODO: consider removing this

Would be nice: get largest free space one, test for authorisation

get_initialised_storage_instance()
get_options_as_dict()
instrumentparametersets
master_box
move_files(dest_box=None)
move_to_master()
objects = <django.db.models.manager.Manager object>
offline_types = [2]
online_types = [3, 1, 4, 6]
options
storage_type
type_order = [3, 6, 1, 2, 4, 5]
class tardis.tardis_portal.models.storage.StorageBoxAttribute(*args, **kwargs)

Bases: django.db.models.base.Model

can hold attributes/metadata about different storage locations.

built-ins: key values description type receiving holds files temporarily for ingestion only

permanent permanent location (assumed by default) cache holds files for fast access
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

objects = <django.db.models.manager.Manager object>
storage_box
class tardis.tardis_portal.models.storage.StorageBoxOption(*args, **kwargs)

Bases: django.db.models.base.Model

holds the options passed to the storage class defined in StorageBox. key->value store with support for typed values through pickling when value_type is set to ‘pickle’

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

PICKLE = 'pickle'
STRING = 'string'
TYPE_CHOICES = (('string', 'String value'), ('pickle', 'Pickled value'))
get_value_type_display(*moreargs, **morekwargs)
objects = <django.db.models.manager.Manager object>
storage_box
unpickled_value

tardis.tardis_portal.models.token module

class tardis.tardis_portal.models.token.Token(id, token, experiment, expiry_date, user)

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

experiment
get_absolute_url(*args, **kwargs)
get_next_by_expiry_date(*moreargs, **morekwargs)
get_previous_by_expiry_date(*moreargs, **morekwargs)
get_session_expiry()

A token login should expire at the earlier of a) tomorrow at 4am b) the (end of) the token’s expiry date

It is the responsibility of token_auth to set the session expiry

is_expired()
objects = <tardis.tardis_portal.managers.OracleSafeManager object>
save_with_random_token()
user

Module contents

models/__init__.py