示例#1
0
文件: Method.py 项目: wpjunior/proled
 def __of__(self, parent):
     m=getattr(self, methodattr)
     m=self.__dict__[methodattr]
     wrapper=getattr(m, '_permissionMapper', None)
     if wrapper is None: wrapper=PermissionMapper()
     if hasattr(m,'__of__'): return aqwrap(m, wrapper, parent)
     return m
    def __getattr__(self, name):
        p=self.__dict__['_product']
        d=p.__dict__
        if hasattr(p,name) and name in d:
            m=d[name]
            w=getattr(m, '_permissionMapper', None)
            if w is not None:
                m=aqwrap(m, aq_base(w), self)

            return m

        # Waaa
        m = 'Products.%s' % p.id
        if m in sys.modules and sys.modules[m]._m.has_key(name):
            return sys.modules[m]._m[name]

        raise AttributeError, name
示例#3
0
文件: Method.py 项目: wpjunior/proled
 def __of__(self, parent):
     m=getattr(self, methodattr)
     m=self.__dict__[methodattr]
     if hasattr(m,'__of__'): return aqwrap(m, self, parent)
     return m