#NEWLINE# @ classmethod #NEWLINE# def update( cls , instance , data ) : #NEWLINE# #INDENT# 'Create DeploymentGraph and related DeploymentGraphTask models.\n\n        It is possible to create empty graphs if not tasks data provided.\n\n        :param instance: DeploymentGraph instance\n        :type instance: DeploymentGraph\n        :param data: data to update\n        :type data: dict\n        :returns: instance of new DeploymentGraphModel\n        :rtype: DeploymentGraphModel\n        ' #NEWLINE# data = data . copy ( ) #NEWLINE# tasks = data . pop ( 'tasks' , None ) #NEWLINE# super ( DeploymentGraph , cls ) . update ( instance , data ) #NEWLINE# if ( tasks is not None ) : #NEWLINE# #INDENT# instance . tasks = [ ] #NEWLINE# db ( ) . flush ( ) #NEWLINE# for task in instance : #NEWLINE# #INDENT# instance . tasks . append ( DeploymentGraphTask . create ( task ) ) #NEWLINE# #UNINDENT# #UNINDENT# db ( ) . flush ( ) #NEWLINE# return instance