[Zope] PythonMethod and accessing objects in the ZODB

Andy McKay andym@ActiveState.com
Tue, 7 Nov 2000 13:08:33 -0800


> I'm using the PythonMethod product (latest Version) and Zope2.2.2.
> The method lives inside a ZClass, which has an common instance
> propertysheet. Also the method gets an 'self' as argument.
>
> Question 1:
> How do i access the attributes stored within this propertysheet
> within the method,
> while self.title and self.id gives the desired results.
> self.propertysheet.propertyname (among other experiments)
> raises an error.

self.propertyname should work, if not
self.propertysheets.propertysheetname.propertyname might, I havent tried
this particular thing myself.

> Question 2:
> How do I access objects stored elsewhere in the ZODB,
> for example
> self.REQUEST....path_to_object.object

try:

obj = REQUEST.resolve_url(absolute_url of some object)

> will raise an error......
>
> Thanks in advance.
>
> Hannes.
>
> _______________________________________________
> 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 )
>