>
> db.define_table('person',
>     Field('name'),
>     Field('phone'),  # ---> [‘000-000-1234’,'001-001-1245', ‘three’, 
> ‘banana’]
>     Field('email'),  # ---> {‘office’: '[email protected]', ‘home’:'
> [email protected]'}
>  )
>

For now, you could do something like:

db.define_table('person',
    Field('name'))

db.define_table('phone',
    Field('person', db.person),
    Field('number'))

db.define_table('email',
    Field('person', db.person),
    Field('type'),
    Field('address'))

Or to simplify, you could get rid of the 'phone' table and add 'phone' as a 
list:string field to the 'person' table:

db.define_table('person',
    Field('name'),
    Field('phone', 'list:string'))

Eventually, you might also get rid of the 'email' table and instead add a 
Postgres hstore 'email' field to the 'person' table, but the DAL doesn't 
support that yet. Another option might be MongoDB, though again, the DAL 
doesn't yet support storing dictionaries within a single field. There are 
some other options as well.

Anthony

Reply via email to