Beispiel #1
0
def event_index(request, year=None, month=None, day=None):
    db = default_storage()
    events = Payment.objects(db).order_by("date_time", reverse=True)
    if year:
        events = events.where(date_time__year=year)
        if month:
            events = event.where(date_time__month=month)
            if day:
                events = events.where(date_time__day=day)
    return {"object_list": events}
Beispiel #2
0
def dashboard(request):
    db = default_storage()
    contracts = Contract.objects(db).order_by("next_date_time")
    payments = Payment.objects(db).order_by("date_time")
    return {
        "contracts": contracts,
        "payments": payments,
        "render_rel_delta": render_rel_delta,
        "chart_url_for_payments": chart_url_for_payments,
        "today": datetime.datetime.today(),
        "default_currency": get_default_currency(),
    }