def labor_other_get_total(request): if 'logged' not in request.session: return {'ok': 0, 'msg': 'Please login.'} else: csrf_token = request.params['csrf_token'] is_token = (csrf_token == unicode(request.session.get_csrf_token())) if is_token: labor_other = LaborOtherModel(request) start_date = h.jsdate_to_string(request.params['start_date']) end_date = h.jsdate_to_string(request.params['end_date']) hospcode = request.params['hospcode'] total = labor_other.get_total(hospcode, start_date, end_date) return {'ok': 1, 'total': total}