for row in self.table.data[key]:\r
result.append(self.row_klass(self.table, row))\r
return result\r
+ elif isinstance(key, int):\r
+ return self.row_klass(self.table, self.table.data[key])\r
else:\r
- return self.row_klass(self, table, self.table.data[key])\r
+ raise TypeError('Key must be a slice or integer.')\r
\r
class BoundRow(object):\r
"""Represents a single row of data, bound to a table.\r
# columns with data= option work fine\r
assert r['email'] == 'foo@bar.org'\r
\r
+ # try to splice rows by index\r
+ assert 'name' in stuff.rows[0]\r
+ assert isinstance(stuff.rows[0:], list)\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