What version of web2py? Also, show us the SQL generated by web2py (check db._timings, which you can view via response.toolbar()) as well as the SQL you are running.
Anthony On Sunday, December 11, 2016 at 11:49:53 PM UTC-5, Scott Hunter wrote: > > I'm using a SQLFORM.grid, using a query of the form: > > db.t_dog.id.belongs(dog_ids) > > > > But the listing is erratic; some records only appear when the list is > sorted certain ways (except for the last page); entries on each page are in > order, but entries between pages overlap. > > I thought the problem might be how grid uses limit by to get the records > for a given pages, and sure enough, if I do the query myself, the query > results match what appears on each page. > > For example, when sorting by code #, the start of the whole result looks > like: > > 99 Test Collie 2 >> 1350 Tovah Border Collie 2 >> 1582 Lexi Border Collie 2 >> >> *1702 Bean Border Collie 2* >> >> >> * 1704 Ginger Border Collie 2 3865 Owen Border Collie 2 4099 >> Flirt Border Collie 2** 5169 Super G Border Collie 2* >> 5199 Emme Border Collie 2 >> 5202 Beamer Border Collie 2 >> * 5203 Audie Border Collie 2* > > > But using limitby(0,20), I get: > > 1702 Bean Border Collie 2 >> 1704 Ginger Border Collie 2 >> 3865 Owen Border Collie 2 >> 4099 Flirt Border Collie 2 >> 5169 Super G Border Collie 2 >> 5203 Audie Border Collie 2 > > > This is on OS X using sqlite; it seems to be fine using sqlite on Linux. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

