@treeio_login_required
@handle_response_format
def index_status(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))
 orders = Object.filter_by_request(request, SaleOrder.objects.filter(query), mode='r')
 statuses = Object.filter_by_request(request, SaleStatus.objects, mode='r')
 filters = OrderFilterForm(request.user.profile, '', request.GET)
 total = 0
 for status in statuses:
  status.count = 0
  for order in orders:
   if (order.status == status):
    if (order.status.hidden is False):
     total += 1
     status.count += order.quantity
 return render_to_response('sales/index_status', {'orders': orders, 'statuses': statuses, 'total': total, 'filters': filters}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required @ handle_response_format def index_status ( 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 ) ) orders = Object . filter_by_request ( request , SaleOrder . objects . filter ( query ) , mode = 'r' ) statuses = Object . filter_by_request ( request , SaleStatus . objects , mode = 'r' ) filters = OrderFilterForm ( request . user . profile , '' , request . GET ) total = 0 for status in statuses : status . count = 0 for order in orders : if ( order . status == status ) : if ( order . status . hidden is False ) : total += 1 status . count += order . quantity return render_to_response ( 'sales/index_status' , { 'orders' : orders , 'statuses' : statuses , 'total' : total , 'filters' : filters } , context_instance = RequestContext ( request ) , response_format = response_format )
index status .