Include it in your model, after the auth=Auth(...)
<model>
def define_session(user_id):
session['myuser_id'] = user_id
auth.settings.login_onaccept.append(lambda form:define_session(auth.user.id
))
</model>
and, even the user is logget out, you will have the session['myuser_id']
def user():
if request.args(0) == 'logout':
db(db.nao.userid==session['myuser_id']).update(db.nao.ipadress="")
return dict(form=auth())
Bruno Rocha
http://about.me/rochacbruno/bio
2011/1/13 pk <[email protected]>
> hi
>
> one question:
> def user():
> if request.args(0) == 'logout':
> query
> return dict(form=auth())
> what is if i need there the auth.user.id???
>
> this is my query:
> db(db.nao.userid==auth.user.id).update(db.nao.ipadress="")
>
> is this possible? if not how can i do this?
>
> peter