Download this file

data.html    40 lines (33 with data), 1.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="master.html" />
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
<title>Learning TurboGears 2.0: Quick guide to the Quickstart pages.</title>
</head>
<body>
<h2>Content Type Dispatch</h2>
<p>
This page shows how you can provide multiple pages
directly from the same controller method. This page is generated
from the expose decorator with the template defintion provided.
You can provide a url with parameters and this page will display
the parameters as html, and the json version will express
the entries as JSON.
</p>
<p>Click here for the <a href="${tg.url('/data.json', params=params)}">JSON Version of this page.</a></p>
<p>The data provided in the template call is:
<table>
<py:for each="key, value in params.iteritems()">
<tr>
<td>${key}</td>
<td>${value}</td>
</tr>
</py:for>
</table>
</p>
</body>
</html>