#NEWLINE# def count_user_logs( user , query = None ) : #NEWLINE# #INDENT# if query : #NEWLINE# #INDENT# query &= Q ( 'user' , 'eq' , query . _id ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# query = Q ( 'user' , 'eq' , user . _id ) #NEWLINE# #UNINDENT# return NodeLog . find ( query ) . count ( )