#NEWLINE# def as_sql( self , compiler , connection , template = None , **extra_context ) : #NEWLINE# #INDENT# connection . ops . check_expression_support ( self ) #NEWLINE# ( expression_sql , params ) = compiler . compile ( self . expression ) #NEWLINE# placeholders = { #NEWLINE# #INDENT# 'expression' : expression_sql , #NEWLINE# 'ordering' : ( 'DESC' if self . descending else 'ASC' ) , #NEWLINE# #UNINDENT# } #NEWLINE# placeholders . update ( extra_context ) #NEWLINE# template = ( template or self . template ) #NEWLINE# return ( ( template % placeholders ) . rstrip ( ) , params )