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).select():
retVal += entity.name2
BUT
As you well know, web2py acctuall did ask for table1 info, just in case
I'll do this:
retVal = []
for entity in db(db.table2.id > 0).select():
retVal += entity.table1.name
On a normal hosting, it doesn't matter that much, but on GAE, it does an
extra query to the datastore, and that's just a waste.
Is there a way to avoid that?
Thanks in advance
Yair
--
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.