[Zope-CMF] Re: Monkey patching doesn't seem to work

suresh_vv sureshvv@hotmail.com
Thu, 20 Mar 2003 06:23:46 -0000


--- In zopeCMF@yahoogroups.com, Yuppie <schubbe@w...> wrote:
> Hi!
> 
> suresh_vv wrote:
> > I want to make PortalFolders searchable.
> 

Yuppie:

Thanks for your feedback. But did not help!

Here is the code in my __init__.py

------------------------------------------
from Products.CMFCore import PortalFolder
from Products.CMFCore.CMFCorePermissions import View

def mySearchableText(self):
    "Returns a concatination of all searchable text"
    # Should be overriden by portal objects
    return "%s %s" % (self.Title(), self.Description())

PortalFolder.security = ClassSecurityInfo() 
PortalFolder.security.declareProtected(View, 'SearchableText') 
PortalFolder.SearchableText = mySearchableText

InitializeClass(PortalFolder)
-------------------------------------------

If I add SearchableText as a method to PortalFolder.py in CMFCore,
then everything works!

Any ideas? Can someone verify the same?

Suresh