[BlueBream] pagination in bluebream
Stephan Richter
stephan.richter at gmail.com
Fri Aug 12 09:16:35 EDT 2011
On Friday, August 12, 2011, Joshua Immanuel wrote:
> Is there any other better way of doing this?
The reason you have to load all objects is because you need to sort before
trimming and limiting. So either your RDB loads in all objects and sorts or
your app does. Same difference. (BTW, this has been discussed many times before
on the various mailing lists.)
Now, Zope 2 had the concept of a brain that you can use. If you know your sort
key(s), you can create a small subset of your object and only load that, for
example the tuple: (id, firstName, lastName). Then you can only load those
tuples and sort on that data structure looking up the full object only when
needed. Another approach is to keep a large list of ids per sort key in
already pre-ordered order. This way you can do a search then infer the order
from that sort list and look up the objects.
Regards,
Stephan
--
Entrepreneur and Software Geek
Google me. "Zope Stephan Richter"
More information about the bluebream
mailing list