Hello,
I've been playing with a "Hello, world!" TG app, trying to send
greetings from a controller method:
@turbogears.expose(template="hello.templates.hello")
def hello(self):
import time
return dict(now=time.ctime(),greeting="<p><b>Greetings from the
controller</b></p>")
to a simple Kid template (I'm omitting everything outiside of BODY):
<body>
<h1>Hello, world!</h1>
<span py:replace="greeting">controller greetings go here</span>
</body>
What I get is the <span> element replaced by the html-escaped version
of
the 'greeting' parameter:
<BODY>
<H1>Hello, world!</H1>
<p><b>Greetings from the controller</b></p>
<P ALIGN="center"><IMG
SRC="/tg_static/images/tg_under_the_hood.png"></P>
</BODY>
which is OK I guess, I just haven't learnt how to generate un-ecsaped
content yest. However, there a strange thing happening when I try to do
the
same with the h1 element above:
<body>
<h1 py:replace="greeting">Hello, world!</h1>
<span>controller greetings go here</span>
</body>
gives:
<BODY>
<SPAN>controller greetings go here</SPAN>
<P ALIGN="center"> <IMG
SRC="/tg_static/images/tg_under_the_hood.png"> </P>
</BODY>
Does anybody know what's happening there? I checked out TG r630 today,
and I'm using Kid 0.8 and TurboKid 0.9.0 AFAIR.
TIA,