[Zope3-dev] getService() call local from global Bug/Hook

Roger Ineichen r.ineichen at projekt01.ch
Thu May 27 18:33:06 EDT 2004


Hello

I wrote a global and a local utility.

For to lookup this utilities I use a adapter.
In this adapter I use the principal annotation service.

If I lookup the principal annotation service
from the local utility I use:

zapi.getService(self.context, PrincipalAnnotationServiceName)

If I lookup the principal annotation service 
from the global utility I have to use:

zapi.getService(None, PrincipalAnnotationServiceName)

This ends in code like:

try:
  aService = zapi.getService(self.context, PrincipalAnnotationServiceName)
except:
  aService = zapi.getService(None, PrincipalAnnotationServiceName)

Is there better way for to do that?

The problem is, if I call the principal annotation service
from the adapter which adapts the global utility
I'm on the last (global) service manager and there is no way 
for to go up to the (local) service manager.

Regards
Roger Ineichen
_____________________________
END OF MESSAGE




More information about the Zope3-dev mailing list