[Zope3-Users] Extending the Buddy demo

Dominik Huber dominik.huber at projekt01.ch
Tue Dec 28 11:05:10 EST 2004


Adam Summers wrote:

> <browser:page
>     for=".interfaces.IBuddyFolder"
>     name="hello.html"
>     class=".buddy.BuddyFolder"
>     template="hello.pt"
>     permission="zope.ManageContent"
>     />
>
try

<browser:page
   for=".interfaces.IBuddyFolder"
   name="hello.html"
   template="hello.pt"
   permission="zope.ManageContent"
   />

the class attribute describes a 'view' class and not your 'model' class. 
a view class is a multiadapter to the context (your buddyfolder 
instance) and the request:

class BuddyFolderView:

  def __init__(self, context, request):
      ....

versus

class BuddyFolder:
  def __init__(self):
     ...

such a view class you are going to use  if your context (model) should 
provide additional interfaces.

regards,
dominik



More information about the Zope3-users mailing list