To use an External Method, you need to place your Python source code file in the Extensions directory in of your Zope directory (you may need to create this directory), or in an Extensions directory inside a Product directory, e.g. lib/python/Products/MyProduct/Extensions . Next, create an External Method with Zope's management interface. Choose "External Method" from the list of addable objects and click "Add". Then specify your function name and the name of your source file (without suffix). Voila, your Python code runs in Zope without having to master writing a Zope Product from scratch!
External Methods need not actually be bound to the current Folder, they can operate as a function if you wish. Figure 47 provides two examples showing the difference between a function, KnowNothing and a method, FolderTitle .
return "I know nothing of Folders and such." # this is a method of a folder object |