#NEWLINE# def user_model( self , user ) : #NEWLINE# #INDENT# model = { #NEWLINE# #INDENT# 'name' : user . name , #NEWLINE# 'admin' : user . admin , #NEWLINE# 'server' : ( user . url if user . running else None ) , #NEWLINE# 'pending' : None , #NEWLINE# 'last_activity' : user . last_activity . isoformat ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# if user . spawn_pending : #NEWLINE# #INDENT# model [ 'pending' ] = 'spawn' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if user . stop_pending : #NEWLINE# #INDENT# model [ 'pending' ] = 'stop' #NEWLINE# #UNINDENT# #UNINDENT# return model