#NEWLINE# def get_actual_status_img( request , output_format = 'png' , width = 600 , height = 600 ) : #NEWLINE# #INDENT# if ( reportlab is None ) : #NEWLINE# #INDENT# messages . error ( request , ( ( _ ( 'Module' ) + ' reportlab ' ) + _ ( 'is not available' ) ) ) #NEWLINE# try : #NEWLINE# #INDENT# redirect_to = request . META [ 'HTTP_REFERER' ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# redirect_to = '/' #NEWLINE# #UNINDENT# return HttpResponseRedirect ( redirect_to ) #NEWLINE# #UNINDENT# status_list = Status . objects . all ( ) #NEWLINE# drawing = Drawing ( width , height ) #NEWLINE# pie = Pie3d ( ) #NEWLINE# pie . x = 100 #NEWLINE# pie . y = 100 #NEWLINE# pie . width = ( width / 2 ) #NEWLINE# pie . height = ( height / 2 ) #NEWLINE# pie . labels = [ s . name for s in status_list ] #NEWLINE# pie . data = [ s . task_set . count ( ) for s in status_list ] #NEWLINE# pie . slices [ 3 ] . fontColor = colors . red #NEWLINE# pie . slices [ 0 ] . fillColor = colors . darkcyan #NEWLINE# pie . slices [ 1 ] . fillColor = colors . blueviolet #NEWLINE# pie . slices [ 2 ] . fillColor = colors . blue #NEWLINE# pie . slices [ 3 ] . fillColor = colors . cyan #NEWLINE# pie . slices [ 4 ] . fillColor = colors . aquamarine #NEWLINE# pie . slices [ 5 ] . fillColor = colors . cadetblue #NEWLINE# pie . slices [ 6 ] . fillColor = colors . lightcoral #NEWLINE# drawing . add ( pie ) #NEWLINE# image = drawing . asString ( output_format ) #NEWLINE# response = HttpResponse ( pie , mimetype = ( 'image/%s' % output_format . lower ( ) ) ) #NEWLINE# return response