예제 #1
0
def deleteportfolio(symbol, chatid):
    logger.info('Deleting portfolio... ' + symbol)
    rowcount = Calls.delete().where((Calls.sym == symbol) & (
        Calls.chatid == chatid) & (Calls.type == PORTFOLIO_TYPE)).execute()
    return rowcount
예제 #2
0
def deletewatchlist(symbol, chatid):
    logger.info('Deleting watchlist... ' + symbol)
    rowcount = Calls.delete().where((Calls.sym == symbol)
                                    & (Calls.chatid == chatid)
                                    & (Calls.type == WATCH_TYPE)).execute()
    return rowcount
예제 #3
0
def deletecall(symbol, userid, chatid):
    logger.info('Deleting call... ' + symbol)
    rowcount = Calls.delete().where((Calls.sym == symbol)
                                    & (Calls.chatid == chatid)).execute()
    return rowcount
예제 #4
0
def deleteoldwatchlist():
    calls = Calls.select(Calls.time).where(Calls.type == WATCH_TYPE).order_by(
        Calls.time.desc()).limit(LIMIT)
    Calls.delete().where((Calls.type == WATCH_TYPE)
                         & (Calls.time.not_in(calls))).execute()
예제 #5
0
def deletependingportfolio(chatid):
    Calls.delete().where((Calls.chatid == str(chatid))
                         & (Calls.qty == 0)).execute()
예제 #6
0
def deleteoldcalls():
    calls = Calls.select(Calls.time).where(
        (Calls.type.not_in([WATCH_TYPE, PORTFOLIO_TYPE
                            ]))).order_by(Calls.time.desc()).limit(LIMIT)
    Calls.delete().where((Calls.type.not_in([WATCH_TYPE, PORTFOLIO_TYPE]))
                         & (Calls.time.not_in(calls))).execute()