for row in self.rows:\r
yield row\r
\r
- def __getitem__(self, name):\r
- try:\r
- column = self.columns[name]\r
- except KeyError:\r
- raise KeyError('Key %r not found in Table' % name)\r
- return BoundColumn(self, column, name)\r
+ def __getitem__(self, key):\r
+ return self.rows[key]\r
\r
# just to make those readonly\r
columns = property(lambda s: s._columns)\r
assert 'name' in stuff.rows[0]\r
assert isinstance(stuff.rows[0:], list)\r
\r
+ # [bug] splicing the table gives as valid, working rows\r
+ assert list(stuff[0]) == list(stuff.rows[0])\r
+ assert stuff[0]['name'] == 'Foo Bar'\r
+\r
# changing an instance's base_columns does not change the class\r
assert id(stuff.base_columns) != id(StuffTable.base_columns)\r
stuff.base_columns['test'] = tables.Column()\r