On Aug 1, 10:41 am, Pynthon <[email protected]> wrote:
> 1. =] Nice! But watch this query:
>
> db( db.leden.info == 'Hans' ).select( db.leden.id, db.leden.naam )
>
> It still give me no error so if I enter a where clause the DAL will
> get all the fields?

No. only the fields you asked (id, naam)

> 2. You mean if you don't use [0] this will be the output
>
> output = [1, 'name', 'info'] And to get it nice you need to use [0]?

The output will contain a Rows object with a single item matching the
query. The element [0] is a Storage object. So

    rows=db( db.leden.info == 'Hans' ).select( db.leden.id,
db.leden.naam )
    if rows: # if found
        row=rows[0]
        print row.id, row.naam

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to