[Zope3-Users] Re: Still stuck without views.

Martin Aspeli optilude at gmx.net
Mon May 7 11:56:15 EDT 2007


Robert Norman wrote:
> Hi again,
> I'm trying to learn Zope through the Web Component Development book and 
> find myself stuck implementing simple views. This was posted earlier but 
> and I've worked on it since but feel totally unable to proceed.
> 
> I'm working on WinXP.  I can manipulate simple persistant objects using 
> debugzope. The objects are listed in the ZMI. However I can't do 
> anything with the views supplied as part of the example code.  For 
> example, under debugzope , following the instructions in the text, if I 
> try to examine the supplied view with:
> 
> view = getMultiAdapter((lasagne, request), name=u'index.html')
> 
> I get a lookup error.  Both lasagne, and request are valid objects.  
> Also, from my browser even though the ZMI shows my objects,  any attempt 
> to view them fails. Apparently my view is not being registered. A line 
> does exists in the configuration file that points to the folder 
> containing the view...
> 
> <include package=".browser" />
> 
> This is all code supplied by the book pasted in from the web site -- I 
> don't have the depth of knowledge of Zope yet to figure this out. 

I suspect the configure.zcml itself isn't being parsed. An easy, crude 
way of figuring this out is to introduce a syntax error. Change that 
line to read:

<include package=".browser

i.e. leave it with an unclosed string and an unclosed tag. If Zope fails 
to start up, then there's something else wrong. If Zope starts up 
correctly, then this file isn't being loaded, which explains why it's 
not finding the registrations.

I'm not sure which part of the book you're in, but you may want to try 
to put a file in etc/package-includes called e.g. test-configure.zcml, 
and have it include:

  <include package="my.package" />

where my.package is the name of the package you're currently in.

Martin



More information about the Zope3-users mailing list