in my test project code, i write like this:
code.pyclass index:
def GET(self):
todos = web.select('todo')
# print render.error(list(todos))
# return False
print render.index(todos, header=render.header(), foot=render.foot())
every class i will write render.header() and render.foot(), it is truble..and the header.html and foot.html
are public.
do it has a easy way to bulid it?
eg: in template file can be wrote like: include foot.html...
index.html$def with (todos, header, foot)
$:header
<ul>
$for todo in todos:
<li id="t$
todo.id"><span title="$todo.created">$todo.title</span> <a href="/item/$
todo.id/edit">edit</a> <a href="/drop?id=$
todo.id">x</a></li>
</ul>
<form action="add" method="post">
<p>Add a new item: </p>
<p>
<input type="text" name="title" />
<input type="submit" value="Add" />
</p>
</form>
$:foot
--
每个人都有一片属于自己的森林, 迷失的人迷失了, 相逢的还会再相逢...
Gtalk: iexper(at)
gmail.com