def keywords_cases(keywords): keywords = keywords.split(',') query_str = query_str_start() + 'WHERE ' for keyword in keywords: query_str += '"' + keyword + '" IN case.keywords AND ' query_str += '1 = 1' + query_str_end() return form_json(query_db(query_str))
def appeal(reference_p1, reference_p2, reference_p3): reference_p1 = str(reference_p1) reference_p2 = str(reference_p2) reference_p3 = str(reference_p3) query_str = query_str_start(True) + 'WHERE appeal.reference = "' + reference_p1 + '/' + reference_p2 + '/' + reference_p3 + '"' + query_str_end(True) + ' LIMIT 1' result = query_db(query_str) return form_json(result)
def case(reference_p1, reference_p2): reference_p1 = str(reference_p1) reference_p2 = str(reference_p2) query_str = query_str_start( ) + 'WHERE case.reference = "' + reference_p1 + '/' + reference_p2 + '"' + query_str_end( ) + ' LIMIT 1' result = query_db(query_str) return form_json(result)
def appeal(reference_p1, reference_p2, reference_p3): reference_p1 = str(reference_p1) reference_p2 = str(reference_p2) reference_p3 = str(reference_p3) query_str = query_str_start( True ) + 'WHERE appeal.reference = "' + reference_p1 + '/' + reference_p2 + '/' + reference_p3 + '"' + query_str_end( True) + ' LIMIT 1' result = query_db(query_str) return form_json(result)
def cases(): args = request.args return form_json(advanced_cases_query(d_surname=args.get('d_surname'), d_name=args.get('d_name'), p_surname=args.get('p_surname'), p_name=args.get('p_name'), d_org=args.get('d_org'), p_org=args.get('p_org'), date=args.get('date'), keywords=args.get('keywords'), reference=args.get('reference'), appeals=args.get('appeals')))
def cases(): args = request.args return form_json( advanced_cases_query(d_surname=args.get('d_surname'), d_name=args.get('d_name'), p_surname=args.get('p_surname'), p_name=args.get('p_name'), d_org=args.get('d_org'), p_org=args.get('p_org'), date=args.get('date'), keywords=args.get('keywords'), reference=args.get('reference'), appeals=args.get('appeals')))
def party_cases(): surname = request.args.get('surname') name = request.args.get('name') return form_json(query_cases_by_party(name, surname))
def party_surname_name_cases(surname, name): return form_json(query_cases_by_party(name, surname))
def appeals_by_case_reference(reference_p1, reference_p2): query_str = query_str_start(True) + 'WHERE case.reference = "' + str(reference_p1) + '/' + str(reference_p2) + '"' + query_str_end(True) + ' LIMIT 1' result = query_db(query_str) return form_json(result)
def appeals(): result = query_db(query_str_start(True) + query_str_end(True)) return form_json(result)
def date_cases(date): query_str = query_str_start() + 'WHERE case.date = "' + date + '"' + query_str_end() result = query_db(query_str) return form_json(result)
def case(reference_p1, reference_p2): reference_p1 = str(reference_p1) reference_p2 = str(reference_p2) query_str = query_str_start() + 'WHERE case.reference = "' + reference_p1 + '/' + reference_p2 + '"' + query_str_end() + ' LIMIT 1' result = query_db(query_str) return form_json(result)
def appeals_by_case_reference(reference_p1, reference_p2): query_str = query_str_start(True) + 'WHERE case.reference = "' + str( reference_p1) + '/' + str(reference_p2) + '"' + query_str_end( True) + ' LIMIT 1' result = query_db(query_str) return form_json(result)
def date_cases(date): query_str = query_str_start( ) + 'WHERE case.date = "' + date + '"' + query_str_end() result = query_db(query_str) return form_json(result)