예제 #1
0
파일: main.py 프로젝트: GonePostal/groat
def form():
    request_json = request.get_json()
    result_json = calculation.calculate_result(request_json)
    result_dict = db.store_results(request.args, request_json, result_json,
                                   collection_name)
    return jsonify(**result_dict)
예제 #2
0
파일: sandbox.py 프로젝트: GonePostal/groat
from calculation import calculate_result


dummy_request_json = {
  "savings_targets": [{"name": "NY trip","amount": '120.00',"date": "2014-09-12"},
                      {"name": "New shoes","amount": '1500.00',"date": "2014-07-03"}
                     ],
  "existing_savings": '134.26',
  "session_id": "ae98-08c2-bd39-a167"
}

print(calculate_result(dummy_request_json))
예제 #3
0
파일: main.py 프로젝트: GonePostal/groat
def form():
    request_json = request.get_json()
    result_json = calculation.calculate_result(request_json)
    result_dict = db.store_results(request.args, request_json, result_json, collection_name)
    return jsonify(**result_dict)
예제 #4
0
from calculation import calculate_result

dummy_request_json = {
    "savings_targets": [{
        "name": "NY trip",
        "amount": '120.00',
        "date": "2014-09-12"
    }, {
        "name": "New shoes",
        "amount": '1500.00',
        "date": "2014-07-03"
    }],
    "existing_savings":
    '134.26',
    "session_id":
    "ae98-08c2-bd39-a167"
}

print(calculate_result(dummy_request_json))