#NEWLINE# @ classmethod #NEWLINE# def current_for_user( kls , user ) : #NEWLINE# #INDENT# sessions = list ( kls . objects . filter ( user = user ) . order_by ( '-start' ) [ : 1 ] ) #NEWLINE# if sessions : #NEWLINE# #INDENT# sess = sessions [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# sess = kls ( user = user ) #NEWLINE# sess . save ( ) #NEWLINE# #UNINDENT# return sess