#NEWLINE# def __unicode__( self ) : #NEWLINE# #INDENT# "Return a rendered Digg-style pagination (by default).\n\n        The callable *settings.PAGE_LIST_CALLABLE* can be used to customize\n        how the pages are displayed. The callable takes the current page number\n        and the total number of pages, and must return a sequence of page\n        numbers that will be displayed. The sequence can contain other values:\n\n            - *'previous'*: will display the previous page in that position;\n            - *'next'*: will display the next page in that position;\n            - *'first'*: will display the first page as an arrow;\n            - *'last'*: will display the last page as an arrow;\n            - *None*: a separator will be displayed in that position.\n\n        Here is an example of custom calable that displays the previous page,\n        then the first page, then a separator, then the current page, and\n        finally the last page::\n\n            def get_page_numbers(current_page, num_pages):\n                return ('previous', 1, None, current_page, 'last')\n\n        If *settings.PAGE_LIST_CALLABLE* is None an internal callable is used,\n        generating a Digg-style pagination. The value of\n        *settings.PAGE_LIST_CALLABLE* can also be a dotted path to a callable.\n        " #NEWLINE# if ( len ( self ) > 1 ) : #NEWLINE# #INDENT# callable_or_path = settings . PAGE_LIST_CALLABLE #NEWLINE# if callable_or_path : #NEWLINE# #INDENT# if callable ( callable_or_path ) : #NEWLINE# #INDENT# pages_callable = callable_or_path #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# pages_callable = loaders . load_object ( callable_or_path ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# pages_callable = utils . get_page_numbers #NEWLINE# #UNINDENT# pages = [ ] #NEWLINE# for item in pages_callable ( self . _page . number , len ( callable_or_path ) ) : #NEWLINE# #INDENT# if ( item is None ) : #NEWLINE# #INDENT# pages . append ( None ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( item == 'previous' ) : #NEWLINE# #INDENT# pages . append ( self . previous ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( item == 'next' ) : #NEWLINE# #INDENT# pages . append ( self . next ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( item == 'first' ) : #NEWLINE# #INDENT# pages . append ( self . first_as_arrow ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( item == 'last' ) : #NEWLINE# #INDENT# pages . append ( self . last_as_arrow ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# pages . append ( self [ item ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# context = RequestContext ( self . _request , { #NEWLINE# #INDENT# 'pages' : pages , #NEWLINE# #UNINDENT# } ) #NEWLINE# return loader . render_to_string ( 'el_pagination/show_pages.html' , context ) #NEWLINE# #UNINDENT# return ''