Ejemplo n.º 1
0
def isStrategyExisted(strategy_id):
    strdao = StrategyInfoDao()
    strategy = strdao.getStrategyByID(strategy_id)
    if not strategy or strategy.count() == 0:
        return False
    else:
        return True
Ejemplo n.º 2
0
def isStrategyExisted(strategy_id):
    strdao = StrategyInfoDao()
    strategy = strdao.getStrategyByID(strategy_id)
    if not strategy or strategy.count() == 0:
        return False
    else:
        return True
Ejemplo n.º 3
0
def queryStrategy(request):
    strategy_id = request.REQUEST.get('strategy_id', '')
    if strategy_id == '':
        return 0
    strdao = StrategyInfoDao()
    result = strdao.getStrategyByID(strategy_id)
    rlist = []
    for str in result:
        rdict = str
        rdict.pop('_id')
        try:
            rdict['status'] = get_task_status(strategy_id)
        except Exception, e:
            pass
        rlist.append(rdict)
Ejemplo n.º 4
0
def queryStrategy(request):
    strategy_id = request.REQUEST.get('strategy_id','')
    if strategy_id == '':
        return 0
    strdao = StrategyInfoDao()
    result = strdao.getStrategyByID(strategy_id)
    rlist = []
    for str in result:
        rdict = str
        rdict.pop('_id')
        try:
            rdict['status'] = get_task_status(strategy_id)
        except Exception, e:
            pass
        rlist.append(rdict)