示例#1
0
 def __getattribute__(self, name):
     dec_map = {'create':expose,
                'read':expose.safe,
                'update':expose.idempotent,
                'delete':expose.idempotent}
     if name in dec_map:
         method = ExposedBase.__getattribute__(self, name)
         if not callable(method):
             msg = 'Attribute %s of %s should be callable' % (method, self)
             raise TypeError(msg)
         return dec_map[name](method)
     else:
         return ExposedBase.__getattribute__(self, name)