[web2py] limitby question

2017-03-06 Thread Richard
Hello, I may not understanding something... I am desapointed that I can't simply manipulate offset of the sql... Or should I just manipulate the limit... I mean if I do repetitively thise query in sql : select * form table order by desc limit 10 offset 0 select * form table order by desc limit

Re: [web2py] limitby question

2012-10-11 Thread Richard Vézina
Thanks Niphlod! Richard On Thu, Oct 11, 2012 at 3:23 PM, Niphlod wrote: > as you wish. the point is assigning a limitby=False if you don't want to > use limitby at all. > The code on dal.py sets limitby = False by default, so select() and > select(limitby=False) have the exact same output. > >

Re: [web2py] limitby question

2012-10-11 Thread Niphlod
as you wish. the point is assigning a limitby=False if you don't want to use limitby at all. The code on dal.py sets limitby = False by default, so select() and select(limitby=False) have the exact same output. On Thursday, October 11, 2012 6:59:52 PM UTC+2, Richard wrote: > > Must test also n

Re: [web2py] limitby question

2012-10-11 Thread Richard Vézina
Must test also nmaxrecords : if nmaxrecords is None or nmaxrecords == '-1': limitby=0 elif nminrecords: limitby=(int(nminrecords), int(nmaxrecords)) else: limitby=(0, int(nmaxrecords)) On Thu, Oct 11, 2012 at 12:52 PM, Richard wrote: > Ok, > > In this case, I

Re: [web2py] limitby question

2012-10-11 Thread Richard
Ok, In this case, I would test the startrecord : if nmaxrecords == '-1': limitby=0 elif nminrecords: limitby=(int(nminrecords), int(nmaxrecords)) else: limitby=(0, int(nmaxrecords)) Since if it is not passed the vars will be empty and raise nonetype error. :)

Re: [web2py] limitby question

2012-10-11 Thread Niphlod
I'd go for checking for howmanyrecord = -1 and in your controller if howmanyrecord == '-1': limitby = False else: limitby = (int(startrecord), int(howmanyrecord )) return db(yourquery).select(limitby=limitby) On Thursday, October 11, 2012 6:13:55 PM UTC+2, Richard wrote: > > Hello, >

[web2py] limitby question

2012-10-11 Thread Richard
Hello, I have component tools, they serve to show table build from a query with redirect link. I place them in differents places in my app and depending of the place I would like to be able to pass max number of rows to the underling query used to build the table showed in the component. So I c