Views documentation

Documentation regarding views defined on the cube.

piws.views.highcharts_views: HighChartsBasicPieView

All the views designed in this section are based on the ‘highcharts’ JavaScript library. The aim here is to propose a bunch of views to summarize the database content.

User Views

highcharts_views.HighChartsBasicPieView([...]) Create a basic pie chart using highcharts.
highcharts_views.HighChartsRelationSummaryView([...]) Create a basic table view that summarized an entity relation.
highcharts_views.HighChartsBasicPlotView([...]) Create a basic plot using highcharts.

piws.views.longitudinal_views: Longitudinal views

When dealing with multiple timepoints, it is crucial to display the scores of a subject at these timepoints.

class cubes.piws.views.longitudinal_views.QuestionnaireLongitudinalView(req=None, rset=None, **kwargs)[source]

Create a view that summarized the longitudinal material for a subject.

call(rset=None, patient_id='', **kwargs)[source]

Method that will create the subject longitudinal views.

If no resultset are passed to this method, the current resultset is used.

Only digits answers are considered.

Parameters:

rset: resultset (optional, default None) :

a cw resultset

patient_id: string (optional, default None) :

the patient identifier.

piws.views.table_views: Table views

All the views designed in this section are based on the ‘datatables’ JavaScript library. Such views are convenient to display questionnaires associated answers or huge dataset as we may be confronted when treating genetic data.

User Views

The ‘JhugetableView’ class will send a single request to the server and then everything will be deported to the client. The ‘JtableView’ will interact with the server each time the user interact with the JavaScript table (ie, paging, sorting, ....).


table_views.JHugetableView([req, rset]) Create a table view with DataTables.
table_views.JtableView(*args, **kwargs) Create a table view with DataTables.

Derived Views

table_views.FileAnswerTableView([req, rset]) QuestionnaireRuns table view when subject questionnaires are inserted using the QuestionnaireRun -> file -> File strategy, ie.

Export Views

table_views.PIWSCSVView([req, rset]) Dumps table data in CSV: used by ‘jtable-table’ view.

Ajax inner callbacks

table_views.get_open_answers_data(self) Get the subject answer data.
table_views.get_questionnaires_data(self) Get the questionnaires data.

piws.views.primary: Primary views

Each entity content is displayed with a primary view.

class cubes.piws.views.primary.PIWSFilePrimaryView(req=None, rset=None, **kwargs)[source]

Specific view for File entities where binary content has to be displayed.

render_entity_attributes(entity, separator=';')[source]

Renders all attributes and relations in the ‘attributes’ section. Unwrap binary field.

Parameters:

separator: str (optional, default ‘;’) :

the CSV cell separator.

class cubes.piws.views.primary.PIWSPrimaryView(req=None, rset=None, **kwargs)[source]

Default primary view rendering.

_prepare_side_boxes(entity)[source]

Create the right relation boxes to display.

This is a common functionality to learn the schema by browsing the database content that will enalbe the users to phrase direct RQL to get their data.

In the case of ‘FileSet’ object, go directly to the associated ‘ExternalResource’ if only one ‘FileSet’ has been specified.

render_entity_attributes(entity)[source]

Renders all attributes and relations in the ‘attributes’ section.

cubes.piws.views.primary.registration_callback(vreg)[source]

Update primary views

piws.views.secondary: Secondary views

A request may returns a bunch of results that are displayed in a list where each returned entity is displayed with a secondary view.

class cubes.piws.views.secondary.BaseOutOfContextView(req=None, rset=None, **kwargs)[source]

Default secondary view rendering.

cell_call(row, col)[source]

Create the out of context view template

entity_description(entity)[source]

Generate a dictionary with the entity description.

class cubes.piws.views.secondary.OutOfContextAssessmentView(req=None, rset=None, **kwargs)[source]

Assessment secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the Assessment description.

class cubes.piws.views.secondary.OutOfContextCWSearchView(req=None, rset=None, **kwargs)[source]

CWSearch secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the CWSearch description.

class cubes.piws.views.secondary.OutOfContextCWUploadView(req=None, rset=None, **kwargs)[source]

CWUpload secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the CWUpload description.

class cubes.piws.views.secondary.OutOfContextDeviceView(req=None, rset=None, **kwargs)[source]

Device secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the Device description.

class cubes.piws.views.secondary.OutOfContextExternalFileView(req=None, rset=None, **kwargs)[source]

ExternalFile secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the ExternalFile description.

class cubes.piws.views.secondary.OutOfContextFileSetView(req=None, rset=None, **kwargs)[source]

FileSet secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the FileSet description.

class cubes.piws.views.secondary.OutOfContextFileView(req=None, rset=None, **kwargs)[source]

File secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the File description.

class cubes.piws.views.secondary.OutOfContextGenomicMeasureView(req=None, rset=None, **kwargs)[source]

GenomicMeasure secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the GenomicMeasure description.

class cubes.piws.views.secondary.OutOfContextGenomicPlatformView(req=None, rset=None, **kwargs)[source]

GenomicPlatform secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the GenomicPlatform description.

class cubes.piws.views.secondary.OutOfContextProcessingRunView(req=None, rset=None, **kwargs)[source]

ProcessingRun secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the ProcessingRun description.

class cubes.piws.views.secondary.OutOfContextQuestionView(req=None, rset=None, **kwargs)[source]

Question secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the Question description.

class cubes.piws.views.secondary.OutOfContextQuestionnaireRunView(req=None, rset=None, **kwargs)[source]

QuestionnaireRun secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the QuestionnaireRun description.

class cubes.piws.views.secondary.OutOfContextQuestionnaireView(req=None, rset=None, **kwargs)[source]

Questionnaire secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the Questionnaire description.

class cubes.piws.views.secondary.OutOfContextRestrictedFileView(req=None, rset=None, **kwargs)[source]

RestrictedFile secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the RestrictedFile description.

class cubes.piws.views.secondary.OutOfContextScanView(req=None, rset=None, **kwargs)[source]

Scan secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the Scan description.

class cubes.piws.views.secondary.OutOfContextSnpView(req=None, rset=None, **kwargs)[source]

Snp secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the Snp description.

class cubes.piws.views.secondary.OutOfContextSubjectView(req=None, rset=None, **kwargs)[source]

Subject secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the Subject description.

class cubes.piws.views.secondary.OutOfContextUploadFieldView(req=None, rset=None, **kwargs)[source]

UploadField secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the UploadField description.

class cubes.piws.views.secondary.OutOfContextUploadFileView(req=None, rset=None, **kwargs)[source]

UploadFile secondary rendering.

entity_description(entity)[source]

Generate a dictionary with the UploadFile description.

cubes.piws.views.secondary.registration_callback(vreg)[source]

Update outofcontext views.