Mercurial > p > roundup > code
view roundup/cgi/ComputedAttribute.py @ 1194:d76b3f8d7bc4
make import set the id counter to maxid+1
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 24 Sep 2002 01:36:04 +0000 |
| parents | 55ab0c5b49f9 |
| children |
line wrap: on
line source
class ComputedAttribute: def __init__(self, callable, level): self.callable = callable self.level = level def __of__(self, *args): if self.level > 0: return self.callable if isinstance(self.callable, type('')): return getattr(args[0], self.callable) return self.callable(*args)
