Mercurial > p > roundup > code
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 2876:407f1f17079d | 2880:ab9ae5cc921b |
|---|---|
| 1802 | 1802 |
| 1803 class ShowDict: | 1803 class ShowDict: |
| 1804 ''' A convenience access to the :columns index parameters | 1804 ''' A convenience access to the :columns index parameters |
| 1805 ''' | 1805 ''' |
| 1806 def __init__(self, columns): | 1806 def __init__(self, columns): |
| 1807 self.columns = {} | 1807 if columns: |
| 1808 for col in columns: | 1808 self.columns = {} |
| 1809 self.columns[col] = 1 | 1809 for col in columns: |
| 1810 self.columns[col] = 1 | |
| 1811 else: | |
| 1812 self.__getitem__ = lambda name: 1 | |
| 1813 | |
| 1810 def __getitem__(self, name): | 1814 def __getitem__(self, name): |
| 1811 return self.columns.has_key(name) | 1815 return self.columns.has_key(name) |
| 1812 | 1816 |
| 1813 class HTMLRequest(HTMLInputMixin): | 1817 class HTMLRequest(HTMLInputMixin): |
| 1814 '''The *request*, holding the CGI form and environment. | 1818 '''The *request*, holding the CGI form and environment. |
