#NEWLINE# @ classmethod #NEWLINE# def create( cls , 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 data: tasks and graph name\n        :type data: dict\n        :returns: instance of new DeploymentGraphModel\n        :rtype: DeploymentGraphModel\n        ' #NEWLINE# data = data . copy ( ) #NEWLINE# tasks = data . pop ( 'tasks' , [ ] ) #NEWLINE# deployment_graph_instance = super ( DeploymentGraph , cls ) . create ( data ) #NEWLINE# for task in tasks : #NEWLINE# #INDENT# deployment_graph_instance . tasks . append ( DeploymentGraphTask . create ( task ) ) #NEWLINE# #UNINDENT# db ( ) . flush ( ) #NEWLINE# return deployment_graph_instance