[Zope3-Users] z3c.form and subforms in an AddForm?

Hermann Himmelbauer dusty at qwer.tk
Wed Jul 4 06:21:54 EDT 2007


Am Mittwoch, 4. Juli 2007 00:33 schrieb Matt Bowen:
> That was not at all a silly question! That got me a little closer -- I am
> new enough not to have understood that i needed the ++skin++. Now, instead
> of a 404 page, I get the following when I try to display my object:
>
> 127.0.0.1 - - [03/Jul/2007:18:26:54 -0400] "GET
> /++skin++MovingTargetBrowser/viewguy/ HTTP/1.1" 500 131 "-" "Mozilla/5.0
> (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.4) Gecko/20070515
> Firefox/2.0.0.4"
> zope.component.interfaces.ComponentLookupError:
> ((<z3c.pagelet.zcml.NextActionDisplayForm object at 0x2aaaaaffb6d0>, <
> zope.publisher.browser.BrowserRequest instance URL=
> http://localhost:9080/++skin++MovingTargetBrowser/viewguy/index.html>, <
> movingtarget.nextaction.NextAction object at 0x2adbcf6cd2a8>),
> <InterfaceClass z3c.form.interfaces.IWidgets>, u'')

This looks like some problem with widgets, I'm not sure. Such errors can be 
quite frustrating, I do it like this:

- locate where the adapter is queried, this will be somewhere in the z3c.form 
package
- If not sure, use "print 'HERE I AM'" statements in the source to find out 
where the exception is raised
- When you found the code line, things hopefully resolve
- Sometimes your object/request is not marked with the requested interface, 
you can check that out with a "print 
IRequestedInterface.providedBy(myobject)" in the framework source.

I know that it is probably a bad style to temporarily modify the framework 
source but I can't think of a better solution.

Over the time you'll start to "smell" why these component lookup errors happen 
and resolve them more easily.

> And for edit, I get this:
>
> 127.0.0.1 - - [03/Jul/2007:18:30:30 -0400] "GET
> /++skin++MovingTargetBrowser/viewguy/ HTTP/1.1" 500 201 "-" "Mozilla/5.0
> (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.4) Gecko/20070515
> Firefox/2.0.0.4"
> zope.security.interfaces.Unauthorized:
> (<z3c.pagelet.zcml.NextActionEditForm object at 0x2aaaaaf9dfd0>,
> 'browserDefault', 'zope.ManageContent')
>
> > /opt/zope/zope-3.4.0a1
>
> /lib/python/zope/app/publication/browser.py(66)getDefaultTraversal()
> -> return ob.browserDefault(request)

Maybe you did not log in into the Zope instance? You set the permissions 
to "zope.ManageContent", you could also change this to "zope.Public" and try 
it again.

Regards,
Hermann

-- 
x1 at aon.at
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7


More information about the Zope3-users mailing list