The id of the current logged in user is available in auth.user_id (which is 
None if the user isn't logged in).

Does the contacts table have a reference to the auth_user table, like:

db.define_table('contacts', Field('user', db.auth_user), ...)

If so, the query would be something like:

db((db.auth_user.id == auth.user_id) & (db.auth_user.id == 
db.contacts.user)).select()

See http://web2py.com/book/default/chapter/06#One-to-Many-Relation 
and http://web2py.com/book/default/chapter/08#Authentication.

Anthony


On Friday, November 25, 2011 2:32:09 PM UTC-5, Renato Ramiro wrote:
>
> I have two tables: users and contacts.
>
> And i'd like to show only the contacts of that user that it's logged.
>
> It's the same with the 'edit profile'. Only I have access to change my
> informations.
>
> How can I implement this?
>
> Thanks!
>
>

Reply via email to