Skip to content

Commit d6a478a

Browse files
author
Alexander Smishlajev
committed
ShowDict: return True for any name if columns list is empty.
1 parent a48e272 commit d6a478a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

roundup/cgi/templating.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,9 +1804,13 @@ class ShowDict:
18041804
''' A convenience access to the :columns index parameters
18051805
'''
18061806
def __init__(self, columns):
1807-
self.columns = {}
1808-
for col in columns:
1809-
self.columns[col] = 1
1807+
if columns:
1808+
self.columns = {}
1809+
for col in columns:
1810+
self.columns[col] = 1
1811+
else:
1812+
self.__getitem__ = lambda name: 1
1813+
18101814
def __getitem__(self, name):
18111815
return self.columns.has_key(name)
18121816

0 commit comments

Comments
 (0)