Am 30.10.2007 um 15:41 schrieb Andreas Jung:

Dear all,

a simple question with hopefully a simple answer! How do I access objects
from an object's context or hierarchy?

Acquisition? Traversal using restrictedTraverse()?

Yes, but I'm not sure which.

Say I have a DA, myDA, in my portal root and I have content type that needs to access this to store some attributes in an external database, how do I get hold of it?

import Aqcuisition

class MyContentType():
        def set_connection(self):
                self.connection = Acquisition.ac_aquire('myDA')

raises an AttributeError

I realise that this is probably down to me not getting Aqcuisition but this looks like how it should work going on the description of Aquisition.

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226



_______________________________________________
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to