Thanks. It worked
On Sun, 6 May 2018, 06:03 Massimo Di Pierro
wrote:
> you know you can do
>
> row = db(db.person.id>0).select(limitby=(0,1),orderby='').first()
>
>
> On Tuesday, 1 May 2018 17:06:26 UTC-5, pbreit wrote:
>>
>> I am very sorry, I need to be more careful with my replies.
>>
>> I wa
you know you can do
row = db(db.person.id>0).select(limitby=(0,1),orderby='').first()
On Tuesday, 1 May 2018 17:06:26 UTC-5, pbreit wrote:
>
> I am very sorry, I need to be more careful with my replies.
>
> I wasn't sure if random needed to be imported but it looks like it does.
> So:
>
> impor
I am very sorry, I need to be more careful with my replies.
I wasn't sure if random needed to be imported but it looks like it does. So:
import random
rows = db(db.person.id>0).select()
random_number = random.randrange(0, len(rows))
row = rows[random_number]
return row
--
Resources:
- http://
On Monday, April 30, 2018 at 9:04:57 PM UTC-7, Maurice Waka wrote:
>
> Now another error :invalid syntax: random _number =
> random.randrange(0,rows.count())
>
>
Is the typo just in your post, or in the code you are trying? (Remove
space between "random" and "_number").
/dps
On Tue, 1 May 20
Now another error :invalid syntax: random _number =
random.randrange(0,rows.count())
On Tue, 1 May 2018, 06:55 pbreit wrote:
> Very sorry. Try:
>
> random_number = random.randrange(0, len(rows))
>
>
>
> On Monday, April 30, 2018 at 8:03:45 PM UTC-7, Maurice Waka wrote:
>>
>> I get this error : A
Thanks. I got the count.
On Tue, 1 May 2018, 06:41 Sandeep Patel wrote:
> Try this
> rows = db(db.person.id>0).count()
>
>
> On Tue, May 1, 2018 at 8:33 AM, Maurice Waka
> wrote:
>
>> I get this error : AttributeError: 'Rows' object has no attribute 'count'
>>
>> On Mon, 30 Apr 2018, 22:10 pbr
Very sorry. Try:
random_number = random.randrange(0, len(rows))
On Monday, April 30, 2018 at 8:03:45 PM UTC-7, Maurice Waka wrote:
>
> I get this error : AttributeError: 'Rows' object has no attribute 'count'
>
> On Mon, 30 Apr 2018, 22:10 pbreit >
> wrote:
>
>> I would think something like:
Try this
rows = db(db.person.id>0).count()
On Tue, May 1, 2018 at 8:33 AM, Maurice Waka wrote:
> I get this error : AttributeError: 'Rows' object has no attribute 'count'
>
> On Mon, 30 Apr 2018, 22:10 pbreit wrote:
>
>> I would think something like:
>>
>> rows = db(db.person.id>0).select()
>
I get this error : AttributeError: 'Rows' object has no attribute 'count'
On Mon, 30 Apr 2018, 22:10 pbreit wrote:
> I would think something like:
>
> rows = db(db.person.id>0).select()
> random_number = random.randrange(0, rows.count())
> row = rows[random_number]
> return row
>
> --
> Resource
9 matches
Mail list logo