#NEWLINE# @ allow_build #NEWLINE# def build_csv( request ) : #NEWLINE# #INDENT# systems = models . System . build_objects . all ( ) . order_by ( 'hostname' ) #NEWLINE# response = HttpResponse ( mimetype = 'text/csv' ) #NEWLINE# response [ 'Content-Disposition' ] = 'attachment; filename=build_systems.csv' #NEWLINE# writer = csv . writer ( response ) #NEWLINE# writer . writerow ( [ 'Host Name' , 'Support Tier' , 'Repo. Branch' , 'CPU Throttled' , 'Product Branch' , 'Product Series' , 'Closes Tree' , 'Purposes' , 'Support URL' ] ) #NEWLINE# for s in p : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# row = [ s . hostname , s . buildattribute . support_tier , s . buildattribute . cvsbranch , s . buildattribute . cpu_throttled , s . buildattribute . product_branch , s . buildattribute . product_series , s . buildattribute . closes_tree , ',' . join ( ( str ( p ) for p in s . buildattribute . purposes . all ( ) ) ) , s . buildattribute . support_doc ] #NEWLINE# #UNINDENT# except models . BuildAttribute . DoesNotExist : #NEWLINE# #INDENT# row = ( [ s . hostname ] + [ '' for i in range ( 8 ) ] ) #NEWLINE# #UNINDENT# writer . writerow ( row ) #NEWLINE# #UNINDENT# return response