[Zope3-Users] Trying to use browser:form -> 404
Florian Lindner
mailinglists at xgm.de
Fri Feb 10 18:44:11 EST 2006
Am Samstag, 11. Februar 2006 00:29 schrieb Alen Stanisic:
> On Fri, 2006-02-10 at 22:18 +0100, Florian Lindner wrote:
> > Thanks for your example. But I've the same error, a 404.
> >
> > in views.py:
> >
> > from zope.formlib.form import EditForm
> > from interfaces import IRegistrationForm
> >
> > class registrationForm(EditForm):
> > form_fields = IRegistrationForm
> >
> >
> > in configure.zcml:
> >
> > <page
> > name="registrationForm.html"
> > class=".views.registrationForm"
> > permission="zope.Public"
> > layer="centershock"
> > for="CS.centershock.interfaces.ICentershock" />
> >
> >
> > And I try to call it with:
> >
> > /++skin++centershock/cs/registerForm.html whereas cs is a ICentershock
> > object.
> >
> > It still gives a 404.
> >
> > Any guess what's wrong?
>
> What happens if you changed your view.py to:
>
> from zope.formlib.form import Form
> .
> .
> class registrationForm(Form):
I get a system error:
2006-02-11T00:41:25 ERROR SiteError
http://horus:8080/++skin++centershock/cs/registrationForm.html
Traceback (most recent call last):
File "/home/florian/Zope3/src/zope/publisher/publish.py", line 138, in
publish
result = publication.callObject(request, object)
File "/home/florian/Zope3/src/zope/app/publication/zopepublication.py", line
161, in callObject
return mapply(ob, request.getPositionalArguments(), request)
File "/home/florian/Zope3/src/zope/publisher/publish.py", line 113, in
mapply
return debug_call(object, args)
File "/home/florian/Zope3/src/zope/publisher/publish.py", line 119, in
debug_call
return object(*args)
File "/home/florian/Zope3/src/zope/formlib/form.py", line 738, in __call__
self.update()
File "/home/florian/Zope3/src/zope/formlib/form.py", line 707, in update
self.setUpWidgets()
File "/home/florian/Zope3/src/zope/formlib/form.py", line 770, in
setUpWidgets
adapters=self.adapters, ignore_request=ignore_request
File "/home/florian/Zope3/src/zope/formlib/form.py", line 337, in
setUpEditWidgets
field = form_field.field
AttributeError: 'str' object has no attribute 'field'
127.0.0.1 - - [11/Feb/2006:00:41:25 +0200]
"GET /++skin++centershock/cs/registrationForm.html HTTP/1.1" 500 89 "-"
"Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.3 (like Gecko)"
I get it now with EditForm too (the backtrace above was produced with
EditForm) I think I had a typo that caused the 404 in my last post, sorry!.
Florian
More information about the Zope3-users
mailing list