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:
Are you trying to do something like this?
http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Grouping-and-counting
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/
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()
>
What would f, v be.
I get this error : ValueError : too many values to unpack
On Mon, 30 Apr 2018, 20:38 Richard Vézina
wrote:
>
>
> On Mon, Apr 30, 2018 at 1:21 PM, Maurice Waka
> wrote:
>
>> Sorry I tried to clarify by my new question :
>>
>> If I have a column with data like db.persons with
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
>
> Sorry, man!
>
How can I put on my way?? based on my code!!
--
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
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
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google
On Monday, April 30, 2018 at 10:53:20 AM UTC-7, Ayron Rangel wrote:
>
> I have this:
>
> db.py:
> db.define_table('product_input',
> Field('product', db.product, notnull=True),
> Field('total_price','decimal(7,2)', readable=False,writable=False),
> Field('amount', 'integer', readable
I have this:
db.py:
db.define_table('product_input',
Field('product', db.product, notnull=True),
Field('total_price','decimal(7,2)', readable=False,writable=False),
Field('amount', 'integer', readable=False,writable=False),
Field('supplier', db.supplier, notnull=True),
Field('
Thank you. Let me work on it.
Regards
On Mon, 30 Apr 2018, 20:38 Richard Vézina
wrote:
>
>
> On Mon, Apr 30, 2018 at 1:21 PM, Maurice Waka
> wrote:
>
>> Sorry I tried to clarify by my new question :
>>
>> If I have a column with data like db.persons with data like
>> Carl
>> Junior
>> Maggie
>>
On Mon, Apr 30, 2018 at 1:21 PM, Maurice Waka wrote:
> Sorry I tried to clarify by my new question :
>
> If I have a column with data like db.persons with data like
> Carl
> Junior
> Maggie
> Tom
> Derrick
>
> And each column name has other fields with data such as:
> persons.name persons.age per
Sorry I tried to clarify by my new question :
If I have a column with data like db.persons with data like
Carl
Junior
Maggie
Tom
Derrick
And each column name has other fields with data such as:
persons.name persons.age persons.location persons.occupation
persons.interests
Carl 23 London Neuroscie
Man this is convulated...
Not sure what is in name4 "name4 is a list that contains items found in
db.health.name, as well as other dbs." what items are you referring at??
What other dbs?
Why are you connecting to sqlite by your own...
This check is just weird :
if id == item in name4:
I would
Hi have this structure:
db.py:
#DEFINE PRODUCT INPUT
db.define_table('product_input',
Field('product', db.product, notnull=True),
Field('total_price','decimal(7,2)', readable=False,writable=False),
Field('amount', 'integer', readable=False,writable=False),
Field('supplier', db.sup
If I have a column with data like db.persons with data like
Carl
Junior
Maggie
Tom
Derrick
And each column name has other fields with data such as:
persons.name persons.age persons.location persons.occupation
persons.interests
Carl 23 London Neuroscientist brainy stuff
Junior 25 Tokyo doctor me
17 matches
Mail list logo