RE: [Zope] Testing for and/or avoiding acquisition
look at context.aq_explicit. I had a similar problem a short while ago, got help on this list. So you could search for emails in this list with keyword 'aq_explicit'. And in case I'm wrong about this, someone pls let me know. -----Original Message----- From: Phil Bradbury [mailto:phil.bradbury@man.ac.uk] Sent: Wednesday, July 09, 2003 12:38 To: zope@zope.org Subject: [Zope] Testing for and/or avoiding acquisition Hello. Probably a simple problem but one I can't seem to solve. I have a site with many folders and subfolders, no problem there. What I want to do is to use a file called 'content.html' to be parsed in each folder but that if there is no such file IN THAT FOLDER it uses a no-content.html' file acquired from 'root' level. Is it possible to check ONLY the container folder for the existence of the required 'content.html' file and if it does not exist to use the 'no-content.html' file from above? If so, how is it done? I'm using TAL rather than DTML and my brain is hurting from trying to sort this out!! I have RTFM but still can't seem to figure out the syntax. Help would be much appreciated! Thanks, Phil _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Samir Mishra wrote at 2003-7-9 13:38 +0400:
look at context.aq_explicit. I had a similar problem a short while ago, got help on this list. So you could search for emails in this list with keyword 'aq_explicit'. And in case I'm wrong about this, someone pls let me know.
You can use "aq_explicit" but it is not completely safe (although it will work in most cases). The best way would be to apply the patch "hasattr_unacquired" you find in the Zope collector (hopefully, it will be included in Zope 2.7). Of course, this requires full control over the Zope installation. Finally, you can implement the "hasattr_unacquired" in an External Method and use this. Dieter
participants (2)
-
Dieter Maurer -
Samir Mishra