[Zope] Re: Preserving Context
Javier Subervi
javier_subervi at yahoo.com
Tue Dec 12 08:57:56 EST 2006
From: Suresh V <suresh_vv at ...>
>1. Are you using "container" rather than "context" in your script?
>2. You can pass your context as a "mycontext" parameter to your script.
I have this line of code in my page template for handling the 404 errors:
<div align="center" tal:condition="here/hasSearchEngine">
I changed it thus:
<div align="center" tal:condition="here/hasSearchEngine(mycontext)">
I tested the following script with "mycontext" as a passed parameter:
return 0
catalog = ''
try:
catalog = getattr(mycontext, mycontext.superValues('ZCatalog')[0].id)
except:
pass
if catalog:
return 1
This threw an error concerning "mycontext".
TIA,
Javier
____________________________________________________________________________________
Have a burning question?
Go to www.Answers.yahoo.com and get answers from real people who know.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20061212/e2a982ab/attachment.htm
More information about the Zope
mailing list