Package s3 :: Module s3grouped :: Class S3GroupedItemsReport
[frames] | no frames]

Class S3GroupedItemsReport

source code

     object --+    
              |    
s3rest.S3Method --+
                  |
                 S3GroupedItemsReport

REST Method Handler for Grouped Items Reports


To Do: widget method

Instance Methods
 
apply_method(self, r, **attr)
Page-render entry point for REST interface.
source code
 
widget(self, r, method=None, widget_id=None, visible=True, **attr)
Summary widget method
source code
 
report(self, r, **attr)
Report generator
source code
 
get_report_config(self)
Get the configuration for the requested report, updated with URL options
source code
 
resolve(self, report_config)
Get all field selectors for the report, and resolve them against the resource
source code

Inherited from s3rest.S3Method: __call__

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

Static Methods
 
extract(resource, selectors, orderby)
Extract the data from the resource (default method, can be overridden in report config)
source code
 
export_links(r)
Render export links for the report
source code
 
inject_script(widget_id, options=None)
Inject the groupedItems script and bind it to the container
source code

Inherited from s3rest.S3Method: crud_string

Properties

Inherited from object: __class__

Method Details

apply_method(self, r, **attr)

source code 

Page-render entry point for REST interface.

Parameters:
  • r - the S3Request instance
  • attr - controller attributes
Returns:
output object to send to the view
Overrides: s3rest.S3Method.apply_method

widget(self, r, method=None, widget_id=None, visible=True, **attr)

source code 

Summary widget method

Parameters:
  • r - the S3Request
  • method - the widget method
  • widget_id - the widget ID
  • visible - whether the widget is initially visible
  • attr - controller attributes
Returns:
output
Overrides: s3rest.S3Method.widget

report(self, r, **attr)

source code 

Report generator

Parameters:
  • r - the S3Request instance
  • attr - controller attributes

get_report_config(self)

source code 

Get the configuration for the requested report, updated with URL options

resolve(self, report_config)

source code 

Get all field selectors for the report, and resolve them against the resource

Parameters:
  • resource - the resource
  • config - the report config (will be updated)
Returns:
a dict {selector: rfield}, where rfield can be None if the selector does not resolve against the resource

extract(resource, selectors, orderby)
Static Method

source code 

Extract the data from the resource (default method, can be overridden in report config)

Parameters:
  • resource - the resource
  • selectors - the field selectors
Returns:
list of dicts {colname: value} including raw data (_row)

export_links(r)
Static Method

source code 

Render export links for the report

Parameters:
  • r - the S3Request

inject_script(widget_id, options=None)
Static Method

source code 

Inject the groupedItems script and bind it to the container

Parameters:
  • widget_id - the widget container DOM ID
  • options - dict with options for the widget

Note: options dict must be JSON-serializable