Want to avoid separate query within the second loop. Is this the right way?
Build two sets from two separate joins, one for the parent record and one
for the children. Then run the parent join for the parent loop and the
child join in the 2nd, nested loop
Parent_Data = db(db.parent_record.style=='yellow'),select()
Child_Data = db(db.parent_record.id == db.child_record.parent_id).select()
For r in Parent _Data
print r.parent_name
For n in Child_Data
if n.child_record.parent_id == r.id
print child_record.name
Or is there a way to make only one big join and somehow use a group_by in
the parent, and undo the group_by when printing the child records in the
nested loop below?
thanks,
Alex Glaros
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.