[Zope-dev] ZPT trials and tribulations

Phil Harris phil.harris@zope.co.uk
Fri, 16 Mar 2001 16:59:16 -0000


All,

I'm in the process of trying out the ZPT stuff(thanks to Duncan Booth for
the win32 stuff).

Anyway up, It's all going according to plan but I have a few issues, maybe
someone has a better idea than me what's wrong here.

<code starts here>

<?xml version="1.0" ?>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal">
  <head>
    <title tal:insert="here/title">The title</title>
  </head>
  <body>
    <h2 tal:insert="here/title_or_id">the title</h2>
    <div tal:define="ui python:container.userInfo()">
      <b tal:replace="python:ui['dn']">crap</b>
      <b tal:replace="python:ui['sn']">crap</b>
      <b tal:replace="python:ui['cn']">crap</b>
    </div>
    <hr />
    <a href="index_html">click here to refresh</a>

  </body>
</html>

</code ends here>

The problem is that I'm getting a traceback (I won't bore you with the
details unless I have to) to the effect of 'ui' being unknown.

If I replace the 'div' in the code above with:

<b tal:replace="python:container.userInfo()['dn']">crap</b>
<b tal:replace="python:container.userInfo()['sn']">crap</b>
<b tal:replace="python:container.userInfo()['cn']">crap</b>

then all works according to design, but with a lot more overhead.

btw, the userInfo method returns a dictionary of LDAP information, it works
in all other contexts, so I don't think the problem is there.

Anyone got any ideas?

Phil
phil.harris@zweb.co.uk