#NEWLINE# @ handle_response_format #NEWLINE# @ treeio_login_required #NEWLINE# @ module_admin_required ( ) #NEWLINE# def perspective_add( request , response_format = 'html' ) : #NEWLINE# #INDENT# 'Perspective add' #NEWLINE# if request . POST : #NEWLINE# #INDENT# if ( 'cancel' not in request . POST ) : #NEWLINE# #INDENT# perspective = Perspective ( ) #NEWLINE# form = PerspectiveForm ( request . user . profile , request . POST , instance = perspective ) #NEWLINE# if form . is_valid ( ) : #NEWLINE# #INDENT# perspective = form . save ( ) #NEWLINE# perspective . set_user_from_request ( request ) #NEWLINE# return HttpResponseRedirect ( reverse ( 'core_admin_perspective_view' , args = [ perspective . id ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return HttpResponseRedirect ( reverse ( 'core_admin_index_perspectives' ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# form = PerspectiveForm ( request . user . profile ) #NEWLINE# #UNINDENT# return render_to_response ( 'core/administration/perspective_add' , { #NEWLINE# #INDENT# 'form' : form . as_ul ( ) , #NEWLINE# #UNINDENT# } , context_instance = RequestContext ( request ) , response_format = response_format )