#NEWLINE# def add_to_query( self , query , alias , col , source , is_summary ) : #NEWLINE# #INDENT# '\n        Add the aggregate to the nominated query.\n\n        Expects col to be a tuple (which means this can only be used to count\n        related fields), and transforms it into a NotDeletedCountColumn.\n\n        ' #NEWLINE# try : #NEWLINE# #INDENT# ( table , field ) = col #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# ( table , field ) = ( None , col ) #NEWLINE# #UNINDENT# col = NotDeletedCountColumn ( table , field ) #NEWLINE# return super ( NotDeletedCount , self ) . add_to_query ( query , alias , col , source , is_summary )