Example #1
0
 def __getattr__(self, name):
     try:
         res = self[name]   # Try to get data field
     except KeyError:
         method = getattr(self._object, name)
         res = wpartial(method, [self.id])
         setattr(self, name, res)
     return res
Example #2
0
 def __getattr__(self, name):
     method = getattr(self.object, name)
     kwargs = {} if self.context is None else {'context': self.context}
     res = wpartial(method, self.ids, **kwargs)
     return res