#NEWLINE# def paging_objects( request , objects , number ) : #NEWLINE# #INDENT# paginator = Paginator ( objects , number ) #NEWLINE# page = request . GET . get ( 'page' ) #NEWLINE# try : #NEWLINE# #INDENT# objects_to_show = paginator . page ( objects_to_show ) #NEWLINE# #UNINDENT# except PageNotAnInteger : #NEWLINE# #INDENT# objects_to_show = paginator . page ( 1 ) #NEWLINE# #UNINDENT# except EmptyPage : #NEWLINE# #INDENT# objects_to_show = paginator . page ( page . num_pages ) #NEWLINE# #UNINDENT# return objects_to_show