You are correct in that your explanation describes exactly how web2py
currently works.  But the online manual (and all previous editions)
have shown the two methods to be equivalent.  It's the first example
in the "shortcuts" section of the Database Abstraction Layer
chapter...

http://www.web2py.com/book/default/chapter/06#Shortcuts

Your method works, and is the preferred solution (the book even says
so).  But we should probably either fix the [id] method or eliminate
it from the book.  Probably fixing it would be best since there may be
old code that relies on it.

Thanks,

Joe

On Sep 1, 1:32 am, pbreit <[email protected]> wrote:
> Not equivalent. The square brackets are specifying the id'th item in the 
> result set (which begins counting at 0).
>
> Here's a better shortcut for grabbing one record:
> row = db.table(id)

Reply via email to