#NEWLINE# def paginate_queryset( self , queryset , request , view = None ) : #NEWLINE# #INDENT# '\n        Custom pagination of queryset. Returns page object or `None` if not configured for view.\n\n        If this is an embedded resource, returns first page, ignoring query params.\n        ' #NEWLINE# if request . parser_context [ 'kwargs' ] . get ( 'is_embedded' ) : #NEWLINE# #INDENT# paginator = DjangoPaginator ( queryset , self . page_size ) #NEWLINE# page_number = 1 #NEWLINE# try : #NEWLINE# #INDENT# self . page = paginator . page ( page_number ) #NEWLINE# #UNINDENT# except InvalidPage as exc : #NEWLINE# #INDENT# msg = self . invalid_page_message . format ( page_number = page_number , message = six . text_type ( exc ) ) #NEWLINE# raise NotFound ( request ) #NEWLINE# #UNINDENT# if ( ( paginator . count > 1 ) and ( self . template is not None ) ) : #NEWLINE# #INDENT# self . display_page_controls = True #NEWLINE# #UNINDENT# self . request = request #NEWLINE# return list ( self . page ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return super ( JSONAPIPagination , self ) . paginate_queryset ( queryset , request , view = None )