Re: [web2py] Avoiding extra quries when using DAL

2013-06-04 Thread Carlos Costa
Maybe something like that. You could do the query and save it as a dict and work on it. result = db(db.table2.id > 0).select().as_dict() retVal = [entity.name for entity in result] 2013/6/4 guruyaya > Lets examine this code for a sec: > db.define_table('table1',Field('name')) > db.define_table

[web2py] Avoiding extra quries when using DAL

2013-06-04 Thread guruyaya
Lets examine this code for a sec: db.define_table('table1',Field('name')) db.define_table('table2',Field('table1', db.table1), Field('name2')) Now, if I need a list of all table2 entries, but not the table1 entries, I'll do something like this: retVal = [] for entity in db(db.table2.id > 0).sele