Package s3 :: Module s3report :: Class S3ReportRepresent
[frames] | no frames]

Class S3ReportRepresent

source code

object --+
         |
        S3ReportRepresent


Method to represent the contributing records in a pivot table
cell (cell explore)

The cell-explore record list will typically look like:
    - <record representation>: <fact value(s)>
    - ...
This method controls the first part of each entry.

For customization, configure for the table as:
        report_represent = <subclass>

Instance Methods
 
__init__(self, resource, rows=None, cols=None, facts=None)
Constructor, initializes the method with the report context to allow it to adapt the representation (e.g.
source code
 
__call__(self, record_ids)
Represent record IDs, can be overloaded in subclasses
source code
 
repr_method(self)
Return a representation method for the id-field of self.resource, can be overloaded in subclasses (simpler than implementing __call__ if producing a representation method is sufficient)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, resource, rows=None, cols=None, facts=None)
(Constructor)

source code 

Constructor, initializes the method with the report context to allow it to adapt the representation (e.g. it may often be desirable to not repeat the report axes in the record list)

Parameters:
  • resource - the resource of the report
  • rows - the rows-selector (can be None)
  • cols - the columns-selector (can be None)
  • facts - the list of S3PivotTableFacts showing in the pivot table
Overrides: object.__init__

__call__(self, record_ids)
(Call operator)

source code 

Represent record IDs, can be overloaded in subclasses

@param record_ids: list of record IDs

@returns: a JSON-serializable dict {recordID: representation},
          or None to suppress recordID representation in the
          cell explorer

NB default behavior is not sensitive for report axes

repr_method(self)

source code 

Return a representation method for the id-field of self.resource, can be overloaded in subclasses (simpler than implementing __call__ if producing a representation method is sufficient)

Returns:
a representation method (preferrably a S3Represent)