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

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