Hi Hermann

You can add an inner loop to each user found by the original code:

for row in db(db.person.id==db.thing.owner_id).select(db.person.id, db.
person.name, count, groupby=db.person.name):
  print row.person.name, row[count]
  for t in db(db.thing.owner_id==row.person.id).select(db.thing.name):
    print t.name

Denes


On Saturday, January 23, 2016 at 2:13:36 PM UTC-5, Hermann Tchehoun wrote:
>
> Hi Denes,
> Thanks for your answer. But in your answer, you've removed the "groupby" 
> and the count.
> What I need is to print the 
> - the Owner
> - the quantity of thing owned
> -and the list of these things
>  what you suggest don't give me the number of things.
>
> Is there a way to have all the 3 (owner, number of things, list of thing) 
> at the same time ; i mean something like this:
>
> Alex  2
>     Boat
>     Chair
> Bob  1
>     Shoes
>
>
>

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