Re: [web2py] To display random questions one by one

2015-08-07 Thread 黄祥
perhaps you can use random ref: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#orderby--groupby--limitby--distinct--having-orderby_on_limitby-left-cache https://groups.google.com/forum/#!topic/web2py/-Y2JL2cIQEI best regards, stifan On Thursday, August 6, 2015 at

Re: [web2py] To display random questions one by one

2015-08-05 Thread Fabiano Almeida
Hi Sai, Can you try this: import random ## first option to select question s = number of lines of your table i = random.randint(0,s) ## second option to select question - best: no broke if delete any record on table s = db(db.ins_ques.id 0).select(db.ins_ques.id) i = random.sample(s,1) ##

[web2py] To display random questions one by one

2015-07-28 Thread Sai Harsh Tondomker
I have trying to display random question for every login (Means client get different questions for every login). Here I gave my db.py and def doing paper. Please help me to solve the problem. db.define_table('ins_ques',