On Tue, Nov 11, 2003 at 04:28:55PM -0500, Phil Christensen wrote:
Okay, that answers another question I had, but I'm still not clear on how to get at that service object from a couple of places.
For example, here's my Realm implementation:
class InnerSpaceRealm: __implements__ = portal.IRealm
def requestAvatar(self, avatarId, mind, *interfaces): if pb.IPerspective in interfaces: registry = ### how do i get this? avatar = UserPerspective(mind, registry.get(avatarId)) return pb.IPerspective, avatar, avatar.logout else: raise NotImplementedError("no interface")
what's the right way to get that service object?
Like so: class InnerSpaceRealm: __implements__ = portal.IRealm def __init__(self, service): self.service = service def requestAvatar(self, avatarId, mind, *interfaces): ... ;) There are other ways, but I'm sure you don't need me to point them out. The key is, just do the obvious thing here. There's no special way to manage this. Jp