Forwarding control from a Python script a DTML method in Zope 2.5.1 used to work like this: return _['updoc'](container, request) Now I am getting a Key error on 'updoc' which is a DTML method in the same skinned folder as the script. Any ideas? Kevin
Kevin Carlson wrote:
Forwarding control from a Python script a DTML method in Zope 2.5.1 used to work like this:
return _['updoc'](container, request)
Now I am getting a Key error on 'updoc' which is a DTML method in the same skinned folder as the script.
1. Check that 'updoc' is a DTML-Method and not a DTML-Document. 2. Check Bindings-Tab in PythonScript. Is _ set as namespace-binding? 3. Try to submit the whole namespace to your DTML-Method: return _['updoc'](container, _) -mj
Maik, Thanks for the quick response. Both number 1 and 2 are OK. When I do this : return _['updoc'](container, _) I get an attribute error on guarded_getattr. If I reverse the order of the arguments like (_, container) I get an even stranger error: Error Type: KeyError Error Value: standard_html_header I don't understand this error since I clearly have 'updoc' as the key and the traceback indicates it is coming from the return _['updoc']... line. Any more ideas? Could this be a bug in 2.6? Kevin -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Maik Jablonski Sent: Thursday, December 19, 2002 6:00 PM To: zope@zope.org Subject: [Zope] Re: Calling DTML Kevin Carlson wrote:
Forwarding control from a Python script a DTML method in Zope 2.5.1 used to work like this:
return _['updoc'](container, request)
Now I am getting a Key error on 'updoc' which is a DTML method in the same skinned folder as the script.
1. Check that 'updoc' is a DTML-Method and not a DTML-Document. 2. Check Bindings-Tab in PythonScript. Is _ set as namespace-binding? 3. Try to submit the whole namespace to your DTML-Method: return _['updoc'](container, _) -mj _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
under IE6 with SP1 bad entities are no more allowed in the URI see http://validator.w3.org/docs/errors.html it happens a lot in PLone but Zope is not exempt http://www.zope.org/feedback_site_form?whats_up=Register&origin_url=http://w ww.zope.org/Register will work but it is mere luck, it is not W3C compliant it should be for example instead of &origin &origin Hotmail, Msn, passport.com, passport.net. and my self on my tiny Plone of newbie are not so lucky I am newbie in everything you write about, but I am a very old oldie in matter of html W3C compliant I was in my past teacher, I know it can be difficult to receive such a remark particularly from a not so bright pupil.. but If I dare to write this message it is because I am persuaded it can be important Think to all the bad entities there are every where cgi, asp, php,.. look at in the IE6 list.. there are complaints everywhere but you can't say for once that is really a window bug Have a look on Zope under Amaya from the W3Consortium..
From: "danielle.d-avout" <danielle.d-avout@wanadoo.fr>
http://www.zope.org/feedback_site_form?whats_up=Register&origin_url=http://w
ww.zope.org/Register will work but it is mere luck, it is not W3C compliant it should be for example instead of &origin &origin
Huh? & has always been used to delimit different parameters in a get URL. Are you saying that this is incorrect?
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Lennart Regebro Sent: Thursday, December 19, 2002 3:11 PM To: danielle.d-avout; zope@zope.org Subject: Re: [Zope] sorry to insist! I'm a feeling that I must dare to write this message: don't allow bad entities ruin the code
From: "danielle.d-avout" <danielle.d-avout@wanadoo.fr>
http://www.zope.org/feedback_site_form?whats_up=Register&origin_ur l=http://w
ww.zope.org/Register will work but it is mere luck, it is not W3C compliant it should be for example instead of &origin &origin
Huh? & has always been used to delimit different parameters in a get URL. Are you saying that this is incorrect?
Danielle is right, it is incorrect but only in things that need to validate (HTML, XML). If you are talking in ASCII email, using & alone is just fine (and using & will probably not work). To express it a little more clearly: URLs can have '&' in them, it's just fine. But when an URL occurs as an HTML attribute, like: <a href="http://blah?foo=baz&blah=yarg">hi</a> Using a stand alone '&' is incorrect as '&' in an attribute is the signal for an entity. It really should be '&' Having said that, I can't imagine any major browser ever enforcing this requirement in the next 10-15 years. I also wouldn't consider it "just luck".
Kevin Carlson writes:
Forwarding control from a Python script a DTML method in Zope 2.5.1 used to work like this:
return _['updoc'](container, request) I do not believe that this can work...
"_[...]" calls the looked up object when it is callable. A DTML object is callable. Its result would need to be another DTML object such that it can do something with the remaining call and its arguments.
Now I am getting a Key error on 'updoc' which is a DTML method in the same skinned folder as the script. Seems that "updoc" cannot be reached by your DTML namespace.
How did you call the Python Script from the DTML object? Dieter
This turned out to be a problem in the updoc method, but I couldn't immediately tell due to the somewhat different tracebacks in 2.6. I added <error_tb> to my standard_error page to get the traceback and solve the problem. -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Dieter Maurer Sent: Friday, December 20, 2002 2:58 PM To: Kevin Carlson Cc: zope@zope.org Subject: Re: [Zope] Calling DTML Kevin Carlson writes:
Forwarding control from a Python script a DTML method in Zope 2.5.1 used to work like this:
return _['updoc'](container, request) I do not believe that this can work...
"_[...]" calls the looked up object when it is callable. A DTML object is callable. Its result would need to be another DTML object such that it can do something with the remaining call and its arguments.
Now I am getting a Key error on 'updoc' which is a DTML method in the same skinned folder as the script. Seems that "updoc" cannot be reached by your DTML namespace.
How did you call the Python Script from the DTML object? Dieter _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (6)
-
Charlie Reiman -
danielle.d-avout -
Dieter Maurer -
Kevin Carlson -
Lennart Regebro -
Maik Jablonski