[views/optimization] Prefetch state'names and comment format in wfhistory component
This will avoid later queries to retrieve them.
--- 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: