Zope external methods and Python: Access to object with a dot in the name

Guillaume SAUZON guillaume.sauzon at caramail.com
Thu Jan 3 08:15:20 EST 2002


Hello,

	I using the great zope and the externals methods which is the python
integration corresponding. From theses methods, you can access the
zope objects through the self that is passed to that methods. You can
also access the sub-directories of these objects using the dot.

My method is called in the main folder and it contains an image
folder:

main
|
|
|
|-images
    |
    |-hello.jpg
    |-other.jpg


So, if I try to access the hello.jpg image, to get the height, I will
type something like:
size = self.images.hello.jpg.height

And here is my problem: There is no folder named hello in the folder
images. Python tries to extend the name in the object hierarchy of
course.

Is it possible to do that? I think so cause zope is using the same
internal representation for the objects no ?

In python, can we have a class name containing a . ??

There should be a way. If you have any ideas !!!

Guillaume



More information about the Python-list mailing list