#NEWLINE# def call_with_connection_and_prepared( func ) : #NEWLINE# #INDENT# ( arg_names , varargs , varkwargs , defaults ) = getargspec ( func ) #NEWLINE# updated = ( ( ( 'connection' in arg_names ) or varkwargs ) and ( ( 'prepared' in arg_names ) or varkwargs ) ) #NEWLINE# if ( not updated ) : #NEWLINE# #INDENT# warn ( ( "A Field class whose %s method hasn't been updated to take `connection` and `prepared` arguments." % inner . __name__ ) , PendingDeprecationWarning , stacklevel = 2 ) #NEWLINE# #UNINDENT# def inner( * args , **kwargs ) : #NEWLINE# #INDENT# if ( 'connection' not in kwargs ) : #NEWLINE# #INDENT# from django.db import connection #NEWLINE# kwargs [ 'connection' ] = connection #NEWLINE# warn ( ( '%s has been called without providing a connection argument. ' % func . __name__ ) , PendingDeprecationWarning , stacklevel = 1 ) #NEWLINE# #UNINDENT# if updated : #NEWLINE# #INDENT# return func ( * args , ** kwargs ) #NEWLINE# #UNINDENT# if ( 'connection' in kwargs ) : #NEWLINE# #INDENT# del kwargs [ 'connection' ] #NEWLINE# #UNINDENT# if ( 'prepared' in kwargs ) : #NEWLINE# #INDENT# del kwargs [ 'prepared' ] #NEWLINE# #UNINDENT# return func ( * args , ** kwargs ) #NEWLINE# #UNINDENT# return inner