#NEWLINE# def current_items( self , obj ) : #NEWLINE# #INDENT# 'Display a list of the current position content\n\n        Each item will be wrapped in a admin change form link if the item\n        is editable via the admin. This list also only shows the first 5\n        items in order not to clutter up the admin change list.\n\n        A horizontal rule is placed between returned objects and\n        overlap objects.\n\n        ' #NEWLINE# items = [ ] #NEWLINE# position_contents = obj . positioncontent_set . all ( ) #NEWLINE# for ( i , pobj ) in enumerate ( position_contents [ : 5 ] ) : #NEWLINE# #INDENT# item = unicode ( pobj . content_object ) #NEWLINE# try : #NEWLINE# #INDENT# reverse_name = 'admin:{}_{}_change' . format ( pobj . content_type . app_label , pobj . content_type . model ) #NEWLINE# item_link = reverse ( reverse_name , args = [ pobj . content_object . id ] ) #NEWLINE# item = '<a href="{}">{}</a>' . format ( item_link , unicode ( pobj . content_object ) ) #NEWLINE# #UNINDENT# except ( NoReverseMatch , AttributeError ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# items . append ( '<li>{}</li>' . format ( item ) ) #NEWLINE# if ( ( i + 1 ) == obj . count ) : #NEWLINE# #INDENT# items . append ( '<hr style="background-color:#a2a2a2;"/>' ) #NEWLINE# #UNINDENT# #UNINDENT# if ( position_contents . count ( ) > 5 ) : #NEWLINE# #INDENT# items . append ( '<br/> and {} more' . format ( ( position_contents . count ( ) - 5 ) ) ) #NEWLINE# #UNINDENT# return '<ul>{}</ul>' . format ( '' . join ( items ) )