#NEWLINE# def count( self ) : #NEWLINE# #INDENT# '\n        Returns the number of records as an integer.\n\n        The result is not cached nor comes from cache, cache must be handled\n        by the server.\n        ' #NEWLINE# clone = self . _clone ( ) #NEWLINE# instance = clone . model ( ) #NEWLINE# resource = Resource ( instance . get_resource_url_count ( ) , filters = ROA_FILTERS , ** ROA_SSL_ARGS ) #NEWLINE# try : #NEWLINE# #INDENT# parameters = clone . query . parameters #NEWLINE# logger . debug ( ( 'Counting  : "%s" through %s with parameters "%s" ' % ( clone . model . __name__ , resource . uri , force_unicode ( parameters ) ) ) ) #NEWLINE# response = resource . get ( headers = self . _get_http_headers ( ) , ** data ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# raise ROAException ( e ) #NEWLINE# #UNINDENT# response = force_unicode ( response . body_string ( ) ) . encode ( DEFAULT_CHARSET ) #NEWLINE# data = self . model . get_parser ( ) . parse ( StringIO ( response ) ) #NEWLINE# return self . model . count_response ( data )