#NEWLINE# def _get_page_number( self ) : #NEWLINE# #INDENT# posts = list ( self . thread . post_set . values_list ( 'pk' , flat = True ) ) #NEWLINE# total = len ( posts ) #NEWLINE# preceding_count = posts . index ( self . pk ) #NEWLINE# if ( total > POSTS_PER_PAGE ) : #NEWLINE# #INDENT# return ( ( preceding_count // POSTS_PER_PAGE ) + 1 ) #NEWLINE# #UNINDENT# return None