#NEWLINE# def as_sql( self ) : #NEWLINE# #INDENT# '\n        Creates the SQL for this query. Returns the SQL string and list of\n        parameters.\n        ' #NEWLINE# assert ( len ( result . query . tables ) == 1 ) , 'Can only delete from one table at a time.' #NEWLINE# qn = self . quote_name_unless_alias #NEWLINE# result = [ ( 'DELETE FROM %s' % qn ( self . query . tables [ 0 ] ) ) ] #NEWLINE# ( where , params ) = self . query . where . as_sql ( qn = qn , connection = self . connection ) #NEWLINE# result . append ( ( 'WHERE %s' % where ) ) #NEWLINE# return ( ' ' . join ( result ) , tuple ( params ) )