[web2py] Re: How to select row based on item ID or name

2018-01-04 Thread Paul Ellis
You would still get a Rows Object though, even though there is only 1 row in it. You would need .first() .last() or [0] at the end to get just the row. Or use the shortcut method. db.table[id] On Thursday, 4 January 2018 18:24:26 UTC+1, Dave S wrote: > > > > On Wednesday, January 3, 2018 at

Re: [web2py] Re: How to select row based on item ID or name

2018-01-04 Thread Yoel Benítez Fonseca
You can get algo a row by ID by: row = db.model_name(ID) Where ID stand for the actual record id. On Thu, Jan 4, 2018 at 1:13 PM, Maurice Waka wrote: Second option is better for me On 4 Jan 2018 8:24 PM, "Dave S" wrote: On Wednesday,

Re: [web2py] Re: How to select row based on item ID or name

2018-01-04 Thread Maurice Waka
Second option is better for me On 4 Jan 2018 8:24 PM, "Dave S" wrote: > > > On Wednesday, January 3, 2018 at 10:48:32 PM UTC-8, Maurice Waka wrote: >> >> >> >> >> >> >> >> I have the following code for my DB: >> dbmyhealth.define_table("health", >>

[web2py] Re: How to select row based on item ID or name

2018-01-04 Thread Dave S
On Wednesday, January 3, 2018 at 10:48:32 PM UTC-8, Maurice Waka wrote: > > > > > > > > I have the following code for my DB: > dbmyhealth.define_table("health", > Field('name', 'string'), > Field('definition', 'text', length= 100,), >