#NEWLINE# def __init__( self , request , uid , method = None , field = None , rate = '5/5m' ) : #NEWLINE# #INDENT# self . request = request #NEWLINE# self . uid = uid #NEWLINE# self . method = ( method or [ 'POST' ] ) #NEWLINE# self . limit = None #NEWLINE# self . time = None #NEWLINE# self . cache_keys = [ ] #NEWLINE# self . cache_values = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( ( uid . request . method in ( m . upper ( ) for m in self . method ) ) and settings . ST_RATELIMIT_ENABLE ) : #NEWLINE# #INDENT# ( self . limit , self . time ) = self . split_rate ( rate ) #NEWLINE# self . cache_keys = self . _get_keys ( field ) #NEWLINE# self . cache_values = self . _incr_cache ( )