Hello All,
I try to get the information of the last loggued user on my web2py application.
The goal is to have the user_id number to fix some HTML tags
I have got a SQLITE request
#SELECT user_id FROM auth_event WHERE description LIKE '%connect%' AND time_stamp = (SELECT MAX(time_stamp) FROM auth_event)
This request works perfect
So I would like to put it on default.py
and I try this
query = db.auth_event.description.contains('connect')
query &= db.auth_event.time_stamp.max()
lastUserLogged = db(query).select(db.auth_event.user_id)
But I have a sqlite error with a misuse of max
Could you please help me to find my error
I have try something like that too ...
queryTime = db.auth_event.time_stamp.max()
query = db(queryTime).select(db.auth_time_stamp)
query &= db.auth_event.description.contains('connect')
lastUserLogged = db(query).select(db.auth_event.user_id)
But same error
Thanks in advance