Previous Chapter | Up | Next Section | Contents

External Method Limitations


External Methods can cause a lot of trouble if you aren't careful. Since External Methods have full access to Zope internals you might just shoot yourself in the foot.

One important gotcha to keep in mind is that the Python modules in which External Methods are defined are not imported into Zope in the way Python modules are normally imported. Therefore, you cannot define classes or objects in your External Methods and expect to be able to assign them to attributes of Zope objects. This is because Python's pickle mechanism will not be able to reconstitute these objects from the object database, since it will not be able to find their class definitions. If you want to add your own objects to the Zope hierarchy one good way to do it is to make sure their classes are defined outside the External Method, for example, in the Shared package.

This limitation doesn't prevent you from creating and modifying attributes of Zope objects. It simply limits the sort of changes you can make. Stan is well aware he has to do more research on Python before he tackles these Zope options.

Previous Chapter | Up | Next Section | Contents

Banner.Novgorod.Ru