I assume you have

db.define_table('person',SQLField('name'),SQLField('email')
db.define_table('contact_method',SQLField
('person_id',db.person),SQLField('work_phone'))

you can do:

rows=db(db.person.id==db.contact_method.person_id).select()
for row in rows:
    print row.person.name
    print row.person.email
    print row.contact_method.work_phone

Hope this answer your question.

massimo

On Jun 15, 5:18 am, samwyse <samw...@gmail.com> wrote:
> I have a person table, with names, and a contact_method table, with a
> name column and a very few rows (Work, Home, Cell, Email).  Finally, I
> have a contact table that contains person ids, contact_method ids, and
> the phone numbers, etc, that go along with them.  I want to create a
> view that looks like this:
>
> Name | Work | Home | Cell | Email
> John Doe | x123 |   |   | j....@example.com
> Jane Smith | x456 |   |   | j.sm...@example.com
>
> It is important that we have the ability to occasionally add contact
> methods (IM, Twitter) without having to modify the database, so
> creating new columns in the person table is not feasible.  I did
> someting similar to this using Perl several years ago, but I'm having
> trouble figuring it out in web2py.  Can someone point me to an example
> or otherwise help me out?  Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to