예제 #1
0
def terrplant_rest(jid):
    try:
        for k, v in request.json.iteritems():
            exec '%s = v' % k
            # print k, v
        all_result.setdefault(jid,{}).setdefault('status','none')

        from terrplant_rest import terrplant_model_rest
        result = terrplant_model_rest.terrplant(version_terrplant,run_type,A,I,R,D,nms,lms,nds,lds,chemical_name,pc_code,use,application_method,application_form,solubility)
        # if (result):
        #     all_result[jid]['status']='done'
        #     all_result[jid]['input']=request.json
        #     all_result[jid]['result']=result

        return {'user_id':'admin', 'result': result.__dict__, '_id':jid}
    except Exception, e:
        return errorMessage(e, jid)
예제 #2
0
def terrplant_rest(jid):
    for k, v in request.json.iteritems():
        exec '%s = v' % k
        # print k, v
    all_result.setdefault(jid, {}).setdefault('status', 'none')

    from terrplant_rest import terrplant_model_rest
    result = terrplant_model_rest.terrplant(version_terrplant, run_type, A, I,
                                            R, D, nms, lms, nds, lds,
                                            chemical_name, pc_code, use,
                                            application_method,
                                            application_form, solubility)
    if (result):
        all_result[jid]['status'] = 'done'
        all_result[jid]['input'] = request.json
        all_result[jid]['result'] = result

    return {'user_id': 'admin', 'result': result.__dict__, '_id': jid}
def terrplant_rest(jid):
    try:
        for k, v in request.json.iteritems():
            exec '%s = v' % k
            # print k, v
        all_result.setdefault(jid,{}).setdefault('status','none')

        from terrplant_rest import terrplant_model_rest
        result = terrplant_model_rest.terrplant(version_terrplant,run_type, application_rate, incorporation_depth, runoff_fraction, 
            drift_fraction,EC25_for_nonlisted_seedling_emergence_monocot,EC25_for_nonlisted_seedling_emergence_dicot,
            NOAEC_for_listed_seedling_emergence_monocot,NOAEC_for_listed_seedling_emergence_dicot,chemical_name,
            pc_code,use,application_method,application_form,solubility)
        # if (result):
        #     all_result[jid]['status']='done'
        #     all_result[jid]['input']=request.json
        #     all_result[jid]['result']=result

        return {'user_id':'admin', 'result': result.__dict__, '_id':jid}
    except Exception, e:
        return errorMessage(e, jid)