#NEWLINE# @ classmethod #NEWLINE# def to_model( cls , live_action ) : #NEWLINE# #INDENT# name = getattr ( live_action , 'name' , None ) #NEWLINE# description = getattr ( live_action , 'description' , None ) #NEWLINE# action = live_action . action #NEWLINE# if getattr ( live_action , 'start_timestamp' , None ) : #NEWLINE# #INDENT# start_timestamp = isotime . parse ( live_action . start_timestamp ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# start_timestamp = None #NEWLINE# #UNINDENT# if getattr ( live_action , 'end_timestamp' , None ) : #NEWLINE# #INDENT# end_timestamp = isotime . parse ( live_action . end_timestamp ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# end_timestamp = None #NEWLINE# #UNINDENT# status = getattr ( live_action , 'status' , None ) #NEWLINE# parameters = getattr ( live_action , 'parameters' , dict ( ) ) #NEWLINE# context = getattr ( live_action , 'context' , dict ( ) ) #NEWLINE# callback = getattr ( live_action , 'callback' , dict ( ) ) #NEWLINE# result = getattr ( live_action , 'result' , None ) #NEWLINE# if getattr ( live_action , 'notify' , None ) : #NEWLINE# #INDENT# notify = NotificationsHelper . to_model ( live_action . notify ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# notify = None #NEWLINE# #UNINDENT# model = cls . model ( name = name , description = description , action = action , start_timestamp = start_timestamp , end_timestamp = end_timestamp , status = status , parameters = parameters , context = context , callback = callback , result = result , notify = notify ) #NEWLINE# return model