#NEWLINE# @ classmethod #NEWLINE# def provision( cls , name , databaseinfra ) : #NEWLINE# #INDENT# if ( not isinstance ( databaseinfra , DatabaseInfra ) ) : #NEWLINE# #INDENT# raise ValidationError ( ( 'Invalid databaseinfra type %s - %s' % ( type ( databaseinfra ) , databaseinfra ) ) ) #NEWLINE# #UNINDENT# database = Database ( ) #NEWLINE# database . databaseinfra = databaseinfra #NEWLINE# database . environment = databaseinfra . environment #NEWLINE# database . name = name #NEWLINE# database . full_clean ( ) #NEWLINE# database . save ( ) #NEWLINE# database = Database . objects . get ( pk = database . pk ) #NEWLINE# return database