any options specified in the Meta of a ModelTable were not being
passed along to the constructor of TableOptions. this wasn't noticed
before, but now that order_by is an option of TableBase, it became
obvious.
\r
class ModelTableOptions(TableOptions):\r
def __init__(self, options=None):\r
- super(ModelTableOptions, self).__init__()\r
+ super(ModelTableOptions, self).__init__(options)\r
self.model = getattr(options, 'model', None)\r
self.columns = getattr(options, 'columns', None)\r
self.exclude = getattr(options, 'exclude', None)\r
model = Country\r
order_by = '-name'\r
\r
+ # the order_by option is provided by TableOptions\r
+ assert_equal('-name', SortedCountryTable()._meta.order_by)\r
+\r
# the default order can be inherited from the table\r
assert_equal(('-name',), SortedCountryTable().order_by)\r
assert_equal(4, SortedCountryTable().rows[0]['id'])\r