I'm a little stuck here.... (And please forgive me, I don't really know what i'm doing)... Problem: Getting ForbiddenAttribute: ('__call__', on annotation I am trying to make a tabbed form which shows 'snapin-annotations' as tabs in the same form as the content In the form i look up the snapin-adapters like this: def getSnapInAdapters(self): for iface in component.interface.searchInterface( context=None, search_string=None, base=snapin.interfaces.ISnapInAnnotation): myAdapter = component.queryMultiAdapter( objects=(self.context,), interface=iface, default=None) if myAdapter is None: continue yield myAdapter And then try to adapt the context like this: for myAdapter in self.getSnapInAdapters(): snapin=myAdapter(self.context) Here I get the error like this: snapin=myAdapter(self.context) ForbiddenAttribute: ('__call__', <bdz.testtour.annotation.ContentAnnotationA object at 0x03588510>) <zcml> <adapter factory="bdz.testtour.annotation.ContentAnnotationA" trusted="True" /> </zcml> I must be forgetting something... Will You help? med venlig hilsen / with kind regards Jørgen G. Jørgensen. --- I just like to play with computers, unix, windows, linux, come as they may __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jørgen Jørgensen wrote:
I'm a little stuck here.... (And please forgive me, I don't really know what i'm doing)...
Problem: Getting ForbiddenAttribute: ('__call__', on annotation
I am trying to make a tabbed form which shows 'snapin-annotations' as tabs in the same form as the content
In the form i look up the snapin-adapters like this:
def getSnapInAdapters(self): for iface in component.interface.searchInterface( context=None, search_string=None, base=snapin.interfaces.ISnapInAnnotation): myAdapter = component.queryMultiAdapter( objects=(self.context,), interface=iface, default=None) if myAdapter is None: continue yield myAdapter
And then try to adapt the context like this:
for myAdapter in self.getSnapInAdapters(): snapin=myAdapter(self.context)
Here I get the error like this: snapin=myAdapter(self.context) ForbiddenAttribute: ('__call__', <bdz.testtour.annotation.ContentAnnotationA object at 0x03588510>)
<zcml> <adapter factory="bdz.testtour.annotation.ContentAnnotationA" trusted="True" /> </zcml>
I must be forgetting something... Will You help?
The 'queryMultiAdapter' call has already instantiated the adapter using 'self.context', so you should just be able to use the thing. E.g.: for snapin in self.getSnapInAdapters(): snaping.doSomethingSnappy() Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGJ4RO+gerLs4ltQ4RAhHkAKCW5srn6gjnn7pHtKIEf/EwUXU2xACcCpXI OiEbY5xM8HqvW+pRIq+ckl4= =IQOE -----END PGP SIGNATURE-----
participants (2)
-
J�rgen J�rgensen -
Tres Seaver