Hi, I'd like to implement a messaging system (between the users of the 
website), and I need help to implement it. The way I've done it is to 
create a message table that has fields for the sender, receiver, subject, 
body, two boolean fields that shows whether the sender or the receiver have 
deleted the message (such that it's not shown to them). This is not quite 
working. I am thinking there must be a better way to do it, or somebody 
might have already implemented something. The table is defined as:

db.define_table('messages',
    Field('recipient_id',db.auth_user, label='To'),
    Field('subject','string'),
    Field('body','string'),
    Field('date','datetime'),
    Field('sender_id',db.auth_user),
    Field('sender_deleted','boolean'),
    Field('recipient_deleted','boolean'),
)

and as it obvious, some of the fields are values from the user database. 
Could somebody tell me if I am on the right track or if changes need to be 
made to my structure?

Thanks!

-- 



Reply via email to