Changeset 3845
- Timestamp:
- 12/24/07 10:00:12 (1 year ago)
- Files:
-
- branches/1.0/CHANGELOG.txt (modified) (1 diff)
- branches/1.0/turbogears/paginate.py (modified) (1 diff)
- branches/1.0/turbogears/tests/test_paginate.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/CHANGELOG.txt
r3830 r3845 20 20 exception (#1629). 21 21 * Added missing logger configuration to quickstarted projects (#1630). 22 * Fixed pagination of empty data when a SQL with "group by" is issued (#1641). 22 23 23 24 Contributors 24 25 ~~~~~~~~~~~~ 25 26 26 Toshio Kuratomi, Christoph Zwerschke .27 Toshio Kuratomi, Christoph Zwerschke, ondrejj. 27 28 28 29 branches/1.0/turbogears/paginate.py
r3824 r3845 172 172 (SASelectResults and isinstance(var_data, SASelectResults)) or \ 173 173 (Query and isinstance(var_data, Query)): 174 row_count = var_data.count() 174 row_count = var_data.count() or 0 175 175 if ordering: 176 176 # Build order_by list. branches/1.0/turbogears/tests/test_paginate.py
r3824 r3845 619 619 zero_limit = expose("turbogears.tests.paginate")(zero_limit) 620 620 621 def empty_with_groupby(self): 622 data = session.query(Address).filter(Address.c.id<0).group_by(Address.c.user_id) 623 624 spy = Spy(var_name='data', pages=[], limit=10, page_count=0, 625 order=None, row_count=0) 626 return dict(data=data, spy=spy) 627 628 empty_with_groupby = paginate("data", default_order="id")(empty_with_groupby) 629 empty_with_groupby = expose("turbogears.tests.paginate")(empty_with_groupby) 630 621 631 # end of MyRoot ------------------------------------------------------------ 622 632 … … 895 905 self.request("/zero_limit/?method=%s" % method) 896 906 self.assert_order(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) 907 908 def test_ticket_1641(self): 909 self.request("/empty_with_groupby") 910 self.assert_order() 897 911 898 912