Simply: phones[1].prof_phone.phone and phones[1].provider.edomain if we
supouse that the id 3 is the second result in the row (1 is the index of
the phones rows).
If you don't know the position in the result, but know the id of the row:
for phone in phones:
if phone.prof_phone.id == 2:
print 'Phone: {}, Provider: {}'.format(phone.prof_phone.phone,
phone.provider.edomain)
2014-04-19 14:54 GMT-04:30 Kurt Jensen <[email protected]>:
> I have a left join query:
>
>
> phones=db((db.prof_phone.pid==person_id)&(db.prof_phone.provider>1)).select(db.prof_phone.ALL,db.provider.edomain,
> left=db.provider.on(db.provider.id
> ==db.prof_phone.provider),orderby=db.prof_phone.label)
>
> which gives me an object:
> phones:prof_phone.id prof_phone.label prof_phone.phone
> prof_phone.provider prof_phone.pidprof_phone.editedprovider.edomain2
> Cell(360) 123-9876 2Kurt Jensen (11) 2014-03-26 22:34:40
> vmobl.com3Wife Cell(360) 123-4567 2Kurt Jensen (11)2014-04-17 18:02:18
> vmobl.com
>
>
> Given that I know the value of the id (3) in row 2; How can I retrieve "(360)
> 123-4567" and "vmobl.com" out of the object?
>
> In PHP I always used a multidimensional array keyed by id to store query
> results and could just do $phone[3]['phone'] and $phone[3]['edomain'].
>
> Thanks...
>
> --
> 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.
>
--
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.