[Zope3-dev] binding a view to a contextless object?

Marcus J. Ertl Marcus J. Ertl" <marcus.ertl@larp-welt.de
Sun, 23 Mar 2003 15:25:25 +0100


Hi!

I write a product, which would be a threaded forum for Zope3, keeping
all of it's data inside a pgSQL-Database. 

You will get the code under: http://www.larp-welt.de/lndev/LNForum.zip
(sorry, only zipfile)!

So I got following problem:

I get the message data from my rdb, and put it into my own object (this
object is defined in line 167ff in LNForum.py).

Because I don't want to keep track of all table-definition-alterations
by hand, I have stolen some code from /app/rdb/__init__.py, for
generating the class of this object at runtime (definition in line
185ff).

I also bound a view to this object, using it's very simple Interface,
using:

<browser:page
     for=".interfaces.ILNMessage"
     name="message"
     template="browser/message.pt"
     permission="zope.View"
     />

In zpt I now use:

<tr tal:repeat="item python:context.getThreads(board=1)" class="row"
tal:attributes="class string:row${item/even}">
     <td tal:content="item/@@message">my message</td>
</tr>

to view this, but Zope3 can't find my view!

Bye and thanks
   Marcus J. Ertl

-- 
 Das LARP-Portal im Internet:
LARP-Welt: http://larp-welt.de

!fantasy