comparison zpt/HTML_list_tables.zpt @ 4:e3ee1f358fe6

new version that doesn't use ZSQLExtend but the database connection more directly. new templates to go with that (returned data structures are different)
author casties
date Mon, 07 Jun 2010 14:02:17 +0000
parents 61a3764cd5fb
children
comparison
equal deleted inserted replaced
3:0e2d167d0983 4:e3ee1f358fe6
1 <html tal:define="format python:request.get('format','table')"> 1 <html tal:define="format python:request.get('format','table'); element_id python:request.get('element_id',None)">
2 <head> 2 <head>
3 <meta http-equiv="content-type" content="text/html;charset=utf-8">
3 <title tal:content="template/title">The title</title> 4 <title tal:content="template/title">The title</title>
4 <meta http-equiv="content-type" content="text/html;charset=utf-8">
5 </head> 5 </head>
6 <body> 6 <body>
7 <h2>List of tables for schema <span tal:replace="options/schema"/></h2> 7 <h2>List of tables for schema <span tal:replace="options/schema"/></h2>
8 <tal:block tal:condition="python:format=='select'"> 8 <tal:block tal:condition="python:format=='select'">
9 <select id="tables"> 9 <select tal:attributes="id element_id">
10 <option tal:repeat="tbl options/data" tal:content="tbl/relname"/> 10 <option tal:repeat="tbl options/data/rows" tal:content="python:tbl[0]"/>
11 </select> 11 </select>
12 </tal:block> 12 </tal:block>
13 <tal:block tal:condition="python:format=='table'"> 13 <tal:block tal:condition="python:format=='table'">
14 <table id="tables"> 14 <table tal:attributes="id element_id">
15 <tr tal:repeat="tbl options/data"> 15 <tr tal:repeat="row options/data/rows">
16 <td><a tal:attributes="href tbl/relname" tal:content="tbl/relname"/></td> 16 <td><a tal:define="tbl python:row[0]" tal:attributes="href tbl" tal:content="tbl"/></td>
17 </tr> 17 </tr>
18 </table> 18 </table>
19 </tal:block> 19 </tal:block>
20 </body> 20 </body>
21 </html> 21 </html>