Example #1
0
def lala(request):
    data = []
    for o in RegularExpenses.objects.all():
        c = o.money.get_income(Period.this_month())
        data.append("{0}.{1}".format(*c))
    json_data = serializers.serialize("json", RegularExpenses.objects.all())
    return HttpResponse(json_data, content_type="application/json")
Example #2
0
def debug(request):
    p = Period.this_month()
    mh = MoneyHolder.objects.get(pk=2)
    data = mh.get_income(p)
    return HttpResponse(json.dumps(data), content_type="application/json")