#NEWLINE# def handle_modeladmin( self , modeladmin ) : #NEWLINE# #INDENT# def datepublisher_admin( self , obj ) : #NEWLINE# #INDENT# return ( '%s &ndash; %s' % ( format_date ( obj . publication_date ) , format_date ( obj . publication_end_date , '&infin;' ) ) ) #NEWLINE# #UNINDENT# datepublisher_admin . allow_tags = True #NEWLINE# datepublisher_admin . short_description = _ ( 'visible from - to' ) #NEWLINE# modeladmin . __class__ . datepublisher_admin = datepublisher_admin #NEWLINE# try : #NEWLINE# #INDENT# pos = modeladmin . list_display . index ( 'is_visible_admin' ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# pos = len ( modeladmin . list_display ) #NEWLINE# #UNINDENT# modeladmin . list_display . insert ( ( modeladmin + 1 ) , 'datepublisher_admin' ) #NEWLINE# modeladmin . add_extension_options ( _ ( 'Date-based publishing' ) , { #NEWLINE# #INDENT# 'fields' : [ 'publication_date' , 'publication_end_date' ] , #NEWLINE# #UNINDENT# } )