[Zope] Getting an object from id

Etienne Labuschagne etiennel@geospace.co.za
Fri, 4 May 2001 14:26:59 +0200


I have used the following method successfully:

parameter passed: objectId
folder where I must retrieve the object with the name id from: fooFolder

I use the following code:

o = self.fooFolder.restrictedTraverse(objectId)

This works in a Python Method (the one where you type the Python code in the
browser) and is probably a valid way to do it.

If there are still better ways, let me know!

Etienne

-----Original Message-----
From: Etienne Labuschagne [mailto:etiennel@geospace.co.za]
Sent: Friday, May 04, 2001 1:32 PM
To: Zope user list (E-mail)
Subject: FW: [Zope] Getting an object from id


Hi there

It is the object that is reffered to as a Python Method in the add box of
the management screen.  In simple terms, the one where you write the Python
code in the browser window and not as an external .py file in the extensions
dir.

Regards
Etienne

-----Original Message-----
From: Chris Withers [mailto:chrisw@nipltd.com]
Sent: Friday, May 04, 2001 12:59 PM
To: Etienne Labuschagne
Cc: Zope user list (E-mail)
Subject: Re: [Zope] Getting an object from id


Etienne Labuschagne wrote:
> 
> This causes an AttributeError type with value validate.  This probably
mean
> that this way of aquiring an object is not available in Python Methods,
but
> only in external Python Methods.  I would prefer to use a Python Method
and
> not an external method.

Do you mean Python Method or Python Script?

cheers,

Chris

_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )