Hello,
I'd like to implement a notification system for various events happening in the app. I'd like it to work with the web2py_session_appname table, because it would mean I could piggyback that select. For that, I'd like to add a field to the sessions table, pointing to the user's ID in auth_user. This way, when I have an event, I could look up users' sessions and update their session data to reflect the fact that they have new notifications.
I added a field to the session table (in gluon/globals), so that when it gets created it has a new field, user_id. Problem is, it can't reference auth_user. Further, I need to insert the user id in that field when a user logs in. How would I do that ?
Is there another way to programatically get a user's session(s), provided they're stored in the DB ?