Redesign the report section
- change the strategy:
- In the current implementation reports are based on a query from the database.
- It would be more general if reports are based on a
DataFramecan be filled with the content of a database table including foreign fields or by a dedicated algorithm mixing, for example, different events.
- In the model register the source producing the
DataFrame, a dictionary linking a name to a function.
- The report configuration should contains 6 sections
- Select the source
- Define selection criteria / query. It is based on a string written in natural language and on the
- Transform the source using pandas chaining. It is a string interpreted using python
eval, a general approach which should allow all kind of postprocessing.
- View defining the DataFrame columns which are shown in the Ext JS Grid, the grouping and the summary.
- Summary to customize summary row of the grid: per group, total, etc
- Permission to define roles with can used this report. Add a
JSONfield containing the list of role allowed to see the report
- In order to implement this approach:
- Remove dedicated selector.
Migrate general function from
normalize_history_datato the module
- Create the functions returning a DataFrame with the content of the history table
- Create the functions / method in order to transforme a DataFrame into an Ext JS store, grid
- Modify the database schema to handle additional configuration parameters fo report
Adapt the tools
- Adapt controllers.
- Update the documentation.