That's a tricky question. To begin with, keep it simple. Web2py gives you a 
lot of flexibility to play around with your DB schema. While developing, you 
can easily modify schema or even throw it out and start over. Once you're in 
production, you have to be much more careful.

You could start with a single table and see how far you get.

db.define_table('message',
   Field('from_email'), # sender
   Field('to_email'), # recipient
   Field('subject'),
   Field('body', 'text'),
   Field('ref_id'),
   auth.signature)

The "ref_id" would relate to a prior message so you could build a thread. 
Alternatively, you might need a "thread" table to tie them together. 
"auth_signature" automatically provides a timestamp and user info (if 
someone is logged in).

Reply via email to