# HG changeset patch # User Sylvain Thénault # Date 1479487492 -3600 # Node ID 002007272a766de4aa60845d1ffe9f67110f8afa # Parent 87443f279b0fc9acbdf72b5d1c6afb98ff0f3c6f [views/optimization] Prefetch state'names and comment format in wfhistory component This will avoid later queries to retrieve them. diff -r 87443f279b0f -r 002007272a76 cubicweb/web/views/workflow.py --- a/cubicweb/web/views/workflow.py Fri Nov 18 10:28:41 2016 +0100 +++ b/cubicweb/web/views/workflow.py Fri Nov 18 17:44:52 2016 +0100 @@ -152,7 +152,8 @@ else: sel += ',WF' headers = (_('from_state'), _('to_state'), _('comment'), _('date')) - rql = '%s %s, X eid %%(x)s' % (sel, rql) + sel += ',FSN,TSN,CF' + rql = '%s %s, FS name FSN, TS name TSN, WF comment_format CF, X eid %%(x)s' % (sel, rql) try: rset = self._cw.execute(rql, {'x': eid}) except Unauthorized: