Re: [web2py] Re: How to iterate through column items and display its rows data

2018-04-30 Thread Maurice Waka
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

Re: [web2py] Re: How to iterate through column items and display its rows data

2018-04-30 Thread Maurice Waka
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

Re: [web2py] Re: How to iterate through column items and display its rows data

2018-04-30 Thread pbreit
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:

[web2py] Re: VIEW NAME NOT ID

2018-04-30 Thread pbreit
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/

Re: [web2py] Re: How to iterate through column items and display its rows data

2018-04-30 Thread Sandeep Patel
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() >

Re: [web2py] DAL return all Fields

2018-04-30 Thread Maurice Waka
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

Re: [web2py] Re: How to iterate through column items and display its rows data

2018-04-30 Thread Maurice Waka
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

[web2py] Re: VIEW NAME NOT ID

2018-04-30 Thread Ayron Rangel
> > 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

[web2py] Re: How to iterate through column items and display its rows data

2018-04-30 Thread pbreit
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

[web2py] Re: VIEW NAME NOT ID

2018-04-30 Thread Dave S
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

[web2py] VIEW NAME NOT ID

2018-04-30 Thread Ayron Rangel
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('

Re: [web2py] DAL return all Fields

2018-04-30 Thread Maurice Waka
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 >>

Re: [web2py] DAL return all Fields

2018-04-30 Thread Richard Vézina
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

Re: [web2py] DAL return all Fields

2018-04-30 Thread Maurice Waka
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

Re: [web2py] DAL return all Fields

2018-04-30 Thread Richard Vézina
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

[web2py] PRINT LIST:REFERENCE

2018-04-30 Thread Ayron Rangel
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

[web2py] How to iterate through column items and display its rows data

2018-04-30 Thread Maurice Waka
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