def _order_details(request, order, error=None): logs = order.logs.all().order_by('-date') valid_transitions = [(trans.__name__, verbose_name(trans)) for trans in order.get_valid_transitions(customer=True)] data = { 'order': order, 'logs': logs, 'valid_transitions': valid_transitions, 'states': Order.STATES.items(), 'error': error, } return render_to_response('ecm/shop/shop_order_details.html', data, Ctx(request))
def _order_details(request, order, error=None): logs = order.logs.all().order_by('-date') valid_transitions = [(trans.__name__, verbose_name(trans)) for trans in order.get_valid_transitions(customer=False)] # we get the 1st jobs associated to this order's rows jobs = order.jobs.select_related(depth=2).filter(parent_job__isnull=True) data = { 'order': order, 'logs': logs, 'valid_transitions': valid_transitions, 'states': Order.STATES.items(), 'error': error, 'jobs_tree': json.dumps(_build_jobs_tree(jobs)), } return render_to_response('ecm/industry/order_details.html', data, Ctx(request))
def _order_details(request, order, error=None): logs = order.logs.all().order_by('-date') valid_transitions = [ (trans.__name__, verbose_name(trans)) for trans in order.get_valid_transitions(customer=False) ] # we get the 1st jobs associated to this order's rows jobs = order.jobs.select_related(depth=2).filter(parent_job__isnull=True) data = { 'order': order, 'logs': logs, 'valid_transitions': valid_transitions, 'states': Order.STATES.items(), 'error': error, 'jobs_tree': json.dumps(_build_jobs_tree(jobs)), } return render_to_response('ecm/industry/order_details.html', data, Ctx(request))