Mercurial > p > roundup > code
view roundup/cgi/ComputedAttribute.py @ 1136:7e193bbda38e
added generic item editing
. much nicer layout of template rendering errors
. added context/is_edit_ok and context/is_view_ok convenience methods and
implemented use of them in the classic template
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 13 Sep 2002 03:31:19 +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)
