コード例 #1
0
def modelrun():
    """Run the model
    """
    try:
        from mmodel.mmodel import MModel
        m = MModel(mDatabase=db,mUid=auth.user_id)
        result = m.run()
        return dict( result=False )
    except Exception as e:
        print "Error: %s" % e
        return dict( result=False )
コード例 #2
0
def averifycoefs():
    import json
    result=False
    try:
        tableName=request.post_vars.tableName
        from mmodel.mmodel import MModel
        model = MModel(mDatabase=db,mUid=auth.user_id)
        if tableName=='cima':
            result=model.checkCima()
        elif tableName=='caefectiva':
            result=model.checkCaefectiva()
        elif tableName=='cintervencionr':
            result=model.checkCintervencionr()
        elif tableName=='cintervenciona':
            result=model.checkCintervenciona()
        elif tableName=='cgsuelo':
            result=model.checkCgsuelo()
        elif tableName=='ccosecha':
            result=model.checkCcosecha()
        elif tableName=='cbcampoe':
            result=model.checkCbcampoe()
        elif tableName=='cbcampo':
            result=model.checkCbcampo()
        elif tableName=='cbindustria':
            result=model.checkCbindustria()
        else:
            print "Not here!"
        data={'result': result}
        return json.dumps(data)
    except Exception as e:
        print "Error: %s" % e