1. Ben Bangert
  2. WebHelpers
Issue #63 resolved

Regression: paginate loads whole table when given SqlAlchemy object

Niklas Hambüchen
created an issue

The changeset <<changeset b82b9f9942bb>> replaces {{{ list(obj[slice]) }}} by {{{ list(obj)[slice] }}}

which results in all rows being loaded on e.g. Page(Session.query(MyModel),filter(...)).

Therefore, webhelpers 1.3b1 completely kills performance.

Comments (4)

  1. Mike Orr

    Refined solution in f6adc7aff8bf. I require .getitem, which is a necessary but not sufficient condition for a sliceable object. If the actual slicing fails with "TypeError: unhashable type". as reported in #59 and observed with some other unhashable types, I catch that and raise the incompatible-collection-type error so that the user will know what's wrong.

  2. Log in to comment