On Friday, October 31, 2014 3:47:51 PM UTC-4, Leonel Câmara wrote:
>
> In my opinion this bug is caused by bad design that complicates things 
> unnecessarily. Why are we allowing users to ask for fields in the select 
> for tables they haven't included in the query?
>

But the DAL doesn't really provide a way to explicitly specify the tables 
in the "FROM" clause -- this is inferred from the query and the elements of 
the select. If it is OK to infer the "FROM" tables from the query, why not 
from the select?

Technically, db(db.person.id > 0).select(db.person.name) only tells us 
"SELECT name ... WHERE person.id > 0" -- it doesn't explicitly give us 
"FROM person" -- that has to be inferred. Likewise, 
db().select(db.person.name) only tells us "SELECT name" -- again, "FROM 
person" must be inferred. What's the difference? In both cases, it is 
equally easy to infer the FROM clause, and in neither case is it explicit 
in the DAL code. You can simply think of db().select(db.person.name) as 
"SELECT name FROM person".

Anthony

-- 
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