id	summary	reporter	owner	description	type	status	priority	component	severity	resolution	keywords	cc	release
10724	[PATCH] render inner macros inside the SQLTable macro	falkb	rjollos	Imagine this construct:\r\n{{{\r\n{{{\r\n#!SQLTable\r\nSELECT DISTINCT\r\n  ( SELECT value FROM session_attribute WHERE name='pagemoderator' AND Sid=m.Sid ) AS "Standard",\r\n  "[[Image(" || REPLACE(\r\n                         REPLACE(\r\n                                   ( SELECT value FROM session_attribute WHERE name='picture_href' AND Sid=m.Sid ), '/myproject/raw-attachment/wiki/', '' ), '/', ':')\r\n                       || ", center, 50px)]][[BR]]" ||   ( SELECT value FROM session_attribute WHERE name='name' AND Sid=m.Sid ) AS "Moderator",\r\n  ( SELECT value FROM session_attribute WHERE name='email'          AND Sid=m.Sid ) AS "Email"\r\nFROM\r\n  session_attribute m\r\nWHERE\r\n  name='pagemoderator' AND NOT value=''\r\nORDER BY\r\n  Standard\r\n}}}\r\n}}}\r\n\r\nThe following patch let the table appear with all bells and whistles:\r\n{{{\r\n#!diff\r\nIndex: wikitablemacro/trunk/wikitable/table.py\r\n===================================================================\r\n--- wikitablemacro/trunk/wikitable/table.py_(revision 12458)\r\n+++ wikitablemacro/trunk/wikitable/table.py_(working copy)\r\n@@ -14,6 +14,7 @@\r\n from trac.core import implements\r\n from trac.web.chrome import ITemplateProvider, add_stylesheet\r\n from trac.wiki.formatter import system_message\r\n+from trac.wiki import wiki_to_html\r\n from trac.wiki.macros import WikiMacroBase\r\n from trac.util.html import Markup\r\n from trac.util.text import exception_to_unicode\r\n@@ -64,7 +65,8 @@\r\n             css_class = (idx % 2 == 0) and 'odd' or 'even'\r\n             print >> out, "  <tr class='%s'>" % css_class\r\n             for col in row:\r\n-                print >> out, "<td>%s</td>" % col\r\n+                text = wiki_to_html(StringIO(col).getvalue(), self.env, req)\r\n+                print >> out, "<td>%s</td>" % text\r\n             print >> out, "  </tr>"\r\n \r\n         print >> out, " </tbody>"\r\n}}}	enhancement	closed	normal	WikiTableMacro	normal	duplicate			
