#NEWLINE# @ register . inclusion_tag ( 'datagrid/get_csv_link.html' , takes_context = True ) #NEWLINE# def get_csv_link( context ) : #NEWLINE# #INDENT# getvars = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( 'request' in context ) : #NEWLINE# #INDENT# request = context [ 'request' ] #NEWLINE# getvars = request . GET . copy ( ) #NEWLINE# getvars [ 'is_csv' ] = 1 #NEWLINE# getvars = urllib . urlencode ( getvars ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# getvars [ 'is_csv' ] = 1 #NEWLINE# getvars = urllib . urlencode ( getvars ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'getvars' : context , #NEWLINE# #UNINDENT# }