@treeio_login_required
@handle_response_format
@_process_mass_opportunity_form
def opportunity_index(request, response_format='html'):
 query = Q(status__hidden=False)
 if request.GET:
  if (('status' in request.GET) and request.GET['status']):
   query = _get_filter_query(request.GET)
  else:
   query = (query & _get_filter_query(request.GET))
 filters = OpportunityFilterForm(request.user.profile, '', request.GET)
 statuses = Object.filter_by_request(request, SaleStatus.objects, mode='r')
 opportunities = Object.filter_by_request(request, Opportunity.objects.filter(query), mode='r')
 massform = OpportunityMassActionForm(request.user.profile)
 return render_to_response('sales/opportunity_index', {'opportunities': opportunities, 'filters': filters, 'massform': massform, 'statuses': statuses}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required @ handle_response_format @ _process_mass_opportunity_form def opportunity_index ( request , response_format = 'html' ) : query = Q ( status__hidden = False ) if request . GET : if ( ( 'status' in request . GET ) and request . GET [ 'status' ] ) : query = _get_filter_query ( request . GET ) else : query = ( query & _get_filter_query ( request . GET ) ) filters = OpportunityFilterForm ( request . user . profile , '' , request . GET ) statuses = Object . filter_by_request ( request , SaleStatus . objects , mode = 'r' ) opportunities = Object . filter_by_request ( request , Opportunity . objects . filter ( query ) , mode = 'r' ) massform = OpportunityMassActionForm ( request . user . profile ) return render_to_response ( 'sales/opportunity_index' , { 'opportunities' : opportunities , 'filters' : filters , 'massform' : massform , 'statuses' : statuses } , context_instance = RequestContext ( request ) , response_format = response_format )
sales index page .