[Zope-CMF] Re: monkey patching CMFCore.utils isn't working?!?
Tres Seaver wrote: Florent Guillaume wrote: It might be possible to monkey patch only _checkPermission.func_code, which seems to work on simple tests, but I've never tried it in real life: >>> def f(a): ... print a+1 >>> def g(b): ... print b+2 >>> f(0) 1 >>> f.func_code = g.func_code >>> f(0) 2 Heh, I thought about that, and then decided that tha voodoo factor was too high to suggest. This is voodoo at its best :) Will bookmark this for later! -- Thank you and Cheers, Suresh V. CTO, ParTecs, Bangalore http://www.partecs.com Plone-Zope-Python Consulting ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] CMF Collector: Open Issues
The following supporters have open issues assigned to them in this collector (http://www.zope.org/Collectors/CMF). Assigned and Open jens - "CachingPolicyManager: Support OFS.Cache.CacheManager", [Accepted] http://www.zope.org/Collectors/CMF/408 mhammond - "Windows DevelopmentMode penalty in CMFCore.DirectoryView", [Accepted] http://www.zope.org/Collectors/CMF/366 Pending / Deferred Issues - "Wrong cache association for FSObject", [Pending] http://www.zope.org/Collectors/CMF/255 - "CMFSetup: Windows exports contain CR/LF, LF and even CR newlines", [Pending] http://www.zope.org/Collectors/CMF/266 - "FSPropertiesObject.py cannot handle multiline input for lines, text attributes", [Deferred] http://www.zope.org/Collectors/CMF/271 - "Can't invalidate skin items in a RAMCacheManager", [Pending] http://www.zope.org/Collectors/CMF/343 - "CMFSetup: Workflow Tool export fails with workflows which have scripts", [Pending] http://www.zope.org/Collectors/CMF/373 - "CMFCore.Skinnable.SkinnableObjectManager can merge skin data", [Pending] http://www.zope.org/Collectors/CMF/375 - "Proxy Roles does't work for a Script using portal_catalog.searchResults", [Pending] http://www.zope.org/Collectors/CMF/380 - "workflow notify success should be after reindex", [Pending] http://www.zope.org/Collectors/CMF/389 - "'except ...: pass' in CMFCore/TypesTool.py:_queryFactoryMethod() nullifies VerboseSecurity", [Pending] http://www.zope.org/Collectors/CMF/410 - "Possible bug when using a BTreeFolder Member folder", [Pending] http://www.zope.org/Collectors/CMF/441 - "Possible bug when using a BTreeFolder Members folder", [Pending] http://www.zope.org/Collectors/CMF/442 - "Possible bug when using a BTreeFolder Member folder", [Pending] http://www.zope.org/Collectors/CMF/443 - "Possible bug when using a BTreeFolder Members folder", [Pending] http://www.zope.org/Collectors/CMF/444 Pending / Deferred Features - "Favorite.py: queries and anchors in remote_url", [Pending] http://www.zope.org/Collectors/CMF/26 - "DefaultDublinCore should have Creator property", [Pending] http://www.zope.org/Collectors/CMF/61 - "path criteria on Topic should honor VHM", [Pending] http://www.zope.org/Collectors/CMF/111 - "Document.py: universal newlines", [Pending] http://www.zope.org/Collectors/CMF/174 - "Add condition for transition's action like other action", [Pending] http://www.zope.org/Collectors/CMF/207 - "Major action enhancement", [Pending] http://www.zope.org/Collectors/CMF/232 - "portal_type is undefined in initialization code", [Pending] http://www.zope.org/Collectors/CMF/248 - "CMFTopic Does Not Cache", [Deferred] http://www.zope.org/Collectors/CMF/295 - "Wishlist: a flag that tags the selected action.", [Pending] http://www.zope.org/Collectors/CMF/301 - "CMFDefault should make use of allowCreate()", [Pending] http://www.zope.org/Collectors/CMF/340 - "Nested Skins", [Deferred] http://www.zope.org/Collectors/CMF/377 - "CatalogVariableProvider code + tests", [Pending] http://www.zope.org/Collectors/CMF/378 - "manage_doCustomize() : minor additions", [Pending] http://www.zope.org/Collectors/CMF/382 - "CMF needs View-based TypeInformation", [Pending] http://www.zope.org/Collectors/CMF/437 - "Marker attributes should be deprecated", [Pending] http://www.zope.org/Collectors/CMF/440 ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] CachingPolicy
hello, i have a question about the "_setCacheHeaders" methods inside this file CMFCore/utils.py. Why content is set to aq_parent and not the object itself ? The test of a policy is make with parent of object not this object. If i have a FSImage, the test is make with this context parent and no http cache is set. In my opinion content must be set to context obj, like that: content=obj Maybe this product is not use anymore and http cache manager is use instead. thanks in advance fred ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
Re: [Zope-CMF] CachingPolicy
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 22 Jun 2006, at 15:08, LESUEUR Frédéric wrote: hello, i have a question about the "_setCacheHeaders" methods inside this file CMFCore/utils.py. Why content is set to aq_parent and not the object itself ? The test of a policy is make with parent of object not this object. If i have a FSImage, the test is make with this context parent and no http cache is set. In my opinion content must be set to context obj, like that: content=obj Please look at how it is being invoked inside e.g. CMFCore/FSFile.py or CMFCore/FSImage.py. What gets passed into _setCacheHeaders is *not* the Image or File, but a so-called view emulator. Its parent is indeed the Image or File itself, so the function works correctly. jens -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFEmtE9RAx5nvEhZLIRAqHEAJ9gTAVjqpduu8RN2pCdJCMqIjGRKgCfaZs1 lIBg6YEX7iOKe4B1mRBPtY4= =+19p -END PGP SIGNATURE- ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
Re: [Zope-CMF] CachingPolicy
LESUEUR Frédéric wrote at 2006-6-22 15:08 +0200: >i have a question about the "_setCacheHeaders" methods inside this >file CMFCore/utils.py. > >Why content is set to aq_parent and not the object itself ? The model (underlying the caching policy manager) is that templates (views) access content objects. In the code above "object" is (usually) the template, "object.aq_parent" is the object viewed by the template -- i.e. the content object in the model above. You are right that the model often does not fit: it does not, e.g. for "FSFile" and "FSImage" objects (now fixed in the core). But it also does not fit when the template is used in its own right and not as a view, e.g. a FSDTMLMethod generating a style sheet. The model mentioned above it too narrow. It should be extended by an additional variable "target" (or something similar) which is the object traversed to. This might give the policy handlers enough information to distinguish between the "template views content" and "template is content itself" cases. > ... >The test of a policy is make with parent of object not this object. If >i have a FSImage, the test is make with this context parent and no >http cache is set. This, meanwhile (CMF 1.5 and up) should have been fixed. -- Dieter ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests