Exemplo n.º 1
0
def get_minutes_ago_price(minutes):
    today = datetime.today()
    half_hour_ago = today - timedelta(minutes=minutes)
    price = Price.get_price_before(half_hour_ago)

    if price is not None:
        return int(price.price)
    else:
        return None
Exemplo n.º 2
0
def get_a_day_ago_price():
    today = datetime.today()
    a_day_ago = today - timedelta(days=1)
    price = Price.get_price_before(a_day_ago)

    if price is not None:
        return int(price.price)
    else:
        return None