#NEWLINE# @ cache_page ( settings . ITEM_PAGE_CACHE_SECONDS ) #NEWLINE# def non_wrlc_item( request , num , num_type ) : #NEWLINE# #INDENT# bib = apis . get_bib_data ( num = num , num_type = num_type ) #NEWLINE# if ( not bib ) : #NEWLINE# #INDENT# return render ( request , '404.html' , { #NEWLINE# #INDENT# 'num' : num , #NEWLINE# 'num_type' : num_type . upper ( ) , #NEWLINE# #UNINDENT# } , status = 404 ) #NEWLINE# #UNINDENT# bib [ 'openurl' ] = _openurl_dict ( request ) #NEWLINE# bib [ 'citation_json' ] = citation_json ( request ) #NEWLINE# bib [ 'ILLIAD_LINK' ] = voyager . get_illiad_link ( bib ) #NEWLINE# try : #NEWLINE# #INDENT# bib [ 'REFWORKS_LINK' ] = voyager . get_refworks_link ( bib ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# bib [ 'REFWORKS_LINK' ] = '' #NEWLINE# #UNINDENT# bib [ 'MICRODATA_TYPE' ] = voyager . get_microdata_type ( bib ) #NEWLINE# holdings = [ ] #NEWLINE# for numformat in ( 'LCCN' , 'ISBN' , 'OCLC' ) : #NEWLINE# #INDENT# if bib . get ( numformat ) : #NEWLINE# #INDENT# if ( numformat == 'OCLC' ) : #NEWLINE# #INDENT# num = filter ( ( lambda x : x . isdigit ( ) ) , bib [ numformat ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# num = bib [ numformat ] #NEWLINE# #UNINDENT# openlibhold = apis . openlibrary ( num , numformat ) #NEWLINE# if openlibhold : #NEWLINE# #INDENT# holdings . append ( openlibhold ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return render ( request , 'item.html' , { #NEWLINE# #INDENT# 'bibid' : '' , #NEWLINE# 'bib' : bib , #NEWLINE# 'non_gw' : True , #NEWLINE# 'holdings' : holdings , #NEWLINE# 'link' : '' , #NEWLINE# 'show_ill_link' : True , #NEWLINE# #UNINDENT# } )