#NEWLINE# def delete( self , tree_name , branch_identifier , schema_id ) : #NEWLINE# #INDENT# name = helper . valid_tree_name ( tree_name ) #NEWLINE# conn = helper . setConnection ( ) #NEWLINE# if ( conn is False ) : #NEWLINE# #INDENT# return jsonify ( dict ( status = 400 , success = False , message = 'Too many connections' ) ) #NEWLINE# #UNINDENT# cur = conn . cursor ( cursor_factory = psycopg2 . extras . RealDictCursor ) #NEWLINE# psycopg2 . extras . register_json ( conn ) #NEWLINE# psycopg2 . extensions . register_adapter ( dict , psycopg2 . extras . Json ) #NEWLINE# if ( not helper . tree_exists ( conn , ( name + '_line' ) ) ) : #NEWLINE# #INDENT# conn . close ( ) #NEWLINE# return jsonify ( dict ( status = 400 , success = False , message = ( ( 'No tree named ' + name ) + ' found' ) ) ) #NEWLINE# #UNINDENT# cur . execute ( 'DELETE from exlayer_schema WHERE id= %s RETURNING *' , ( schema_id , ) ) #NEWLINE# line = cur . fetchone ( ) #NEWLINE# conn . commit ( ) #NEWLINE# if ( not line ) : #NEWLINE# #INDENT# conn . close ( ) #NEWLINE# return jsonify ( dict ( status = 400 , success = False , message = 'No schema change with that id.' ) ) #NEWLINE# #UNINDENT# return jsonify ( { #NEWLINE# #INDENT# 'status' : 200 , #NEWLINE# 'success' : True , #NEWLINE# 'message' : ( ( 'schema change with id ' + cur ) + ' has been removed.' ) , #NEWLINE# 'data' : line , #NEWLINE# #UNINDENT# } )