I have the following code for my DB:
dbmyhealth.define_table("health", 
                            Field('name', 'string'),
                            Field('definition', 'text', length= 1000000,),
                            Field('abnval', 'text', length= 1000000,),
                            Field('normval', 'text', length= 1000000,),
                            Field('administration', 'text', length= 
1000000,),
                            Field('screening', 'text', length= 1000000,),
                            Field('causes', 'text', length= 1000000,),
                            migrate = False)

rows  = dbmyhealth().select(dbmyhealth.health.ALL)
for row in rows: 
    location0 = row.name
    location1 = row.definition
    location2 = row.abnvalinterpret
    location3 = row.normvalinterpret
    location4 = row.administration
    location5 = row.screening
    location6 = row.causes
    corpus = [location1 , location2, location3, location4, location5, 
location6]

I want to select an item, including all the fields from the abnval to the 
causes,not randomly but based on the ID or the name. If I use the limitby 
constraint,I can get either the first, second, or last item based on the 
selection used. If I use the below code, I get only the first item, which 
is everything based on obesity. I want to select any item with every query 
using either an ID or the names below e.g.
A code like: 
for row in rows:
    if id == 2
        code..
           corpus = [location1 , location2, location3, location4, 
location5, location6]....in this case my corpus will have everything on 
cardiomyopathy using the table details below.            

id name
0. diabetes
1. hypertension
2. cardiomyopathy
3. copd
4. obesity

So how do I code it to obtain my answer
Kind regards


-- 
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 you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to