Mercurial > p > roundup > code
diff roundup/cgi/templating.py @ 2880:ab9ae5cc921b
ShowDict: return True for any name if columns list is empty.
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Sat, 06 Nov 2004 15:00:47 +0000 |
| parents | 6acc315570eb |
| children | 1ca5ebe9b16a |
line wrap: on
line diff
--- a/roundup/cgi/templating.py Fri Nov 05 20:48:35 2004 +0000 +++ b/roundup/cgi/templating.py Sat Nov 06 15:00:47 2004 +0000 @@ -1804,9 +1804,13 @@ ''' A convenience access to the :columns index parameters ''' def __init__(self, columns): - self.columns = {} - for col in columns: - self.columns[col] = 1 + if columns: + self.columns = {} + for col in columns: + self.columns[col] = 1 + else: + self.__getitem__ = lambda name: 1 + def __getitem__(self, name): return self.columns.has_key(name)
