Just to be clear, the old behavior was a bug (and a particular problem when 
the user sorted on a column within the grid, which overrides the original 
orderby). Pagination is a fundamental feature of the grid, so it ought to 
"just work." Note, we cannot leave it up to the developer to explicitly 
specify the proper set of orderby fields because of the issue with 
user-initiated sorting in the UI (which overrides the default ordering 
specified by the developer).

You have a special case in which you are willing to risk pagination errors 
in order to boost speed. While that might be a reasonable trade-off in your 
particular case, it is not necessarily appropriate default behavior. 
However, we should certainly document the new behavior and the 
auto_pagination option.

If you'd like, you can do something like the following in a model:

import functools
mygrid = functools.partial(SQLFORM.grid, auto_pagination=False)

and then use mygrid in place of SQLFORM.grid in your code (though I suspect 
in most cases you would still prefer the default behavior in order to 
guarantee proper pagination when speed is not an issue).

Anthony

On Monday, June 1, 2015 at 3:33:11 AM UTC-4, Johann Spies wrote:
>
> After reading the discussion Anthony referred to, I would like to state 
> that I prefer the behaviour of the DAL/Grid query to result in the same 
> outcome as if I would have done with a raw query in PostgreSQL. I test my 
> queries in PG before I implement them in web2py because I work with fairly 
> large datasets. PostgreSQL's  pgsql does not use the id-field for 
> pagination if I specify an 'ORDER BY' and that is the way I prefer Web2py's 
> grid to work and as I understand it that is what 'autopagination = False' 
> does.
>
> Thanks for all the hard work and thinking that goes into the coding.
>
> Regards
> Johann
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to