* Cédric Krier [2014-12-20 02:02 +0100]:
On 19 Dec 19:30, Nicolas Évrard wrote:
Hello,

Last week I took some time to change a bit the API of the Report
object. There has always been a need some part of this API that I
did not like eg: I had the impression that the separation between
the data processing part and the rendering part was not clearly
defined.

So I took a peak at the re-implementation of the Report to support
html templating with webkit or pisa (from OpenLabs and Grasbauer
respectively) and also the JasperReport implementation from NaNtiC.

In the end here is the review:

   http://codereview.tryton.org/8831002/

So I added those methods:

   - get_localcontext: it should be used to make the data
     processing part. In theory our modules should only override
     this method

Do we need to keep the name localcontext?

Genshi use the name context, and I think the localcontext name was
introduced in order not to mix with tryton's context.

Jinja and Chameleon use also the name context.

In fact the 'local' part is what bothers me, report_context is better
according to me.

Maybe it is also the time to remove most of the default values set.

What is used currently:

   - records
   - setLang
   - user
   - formatLang
   - datetime
   - time

I think that datetime / time should be removed though and added when
needed (and probably only datetime should be used since time is too
low level).

What could be removed:

   - data
   - context
   - StringIO

I wonder why StringIO is there in fact.

And also refactor and rename formatLang because it is also an odd code.

Can you elaborate?

   - test_postprocess: Test whether or not the report data should be
     postprocessed (think about odt -> doc or html -> pdf)

Why do we need a test_postprocess? We could call postprocess always and
if nothing needs to be done, it does nothing.

Done.

   - postprocess: Make the necessary calls to postprocess the data
     (calling unoconv, pisa, …)

Maybe 'convert' is a better name.

We could also remove compatibility from very old relatorio version.

Done.

--
Nicolas Évrard - B2CK SPRL
E-mail/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Attachment: signature.asc
Description: Digital signature

Reply via email to