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 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to