Beispiel #1
0
def get_tasks_by_date(request):
    utils.dump(request.GET)
    #todo get with param, not Post
    date_filter = datetime.strptime(request.POST.get('date'),  '%a %b %d %H:%M:%S %Z %Y')
    latest_task_list = Task.objects.all().filter(isDeleted=False, date__startswith=date_filter.date()).order_by('-date')
    response = utils.build_obj_from_queryset(latest_task_list);
    return JsonResponse(response, safe=False)
Beispiel #2
0
def get_books(request):
    # utils.dump(request.GET)
    books = Book.objects.all()
    for book in books:
        book.link = book.booklink.url
    response = utils.build_obj_from_queryset(books);
    return JsonResponse(response, safe=False)
Beispiel #3
0
def get_tasks(request):
    utils.dump(request.GET)
    # date = datetime.strptime("Tue Oct 20 09:26:38 GMT 2015",  '%a %b %d %H:%M:%S %Z %Y')
    # latest_task_list = Task.objects.all().filter(date=date).order_by('-date')
    latest_task_list = Task.objects.all().filter(isDeleted=False).order_by('-date')
    response = utils.build_obj_from_queryset(latest_task_list);
    return JsonResponse(response, safe=False)
Beispiel #4
0
def get_books(request):
    # utils.dump(request.GET)
    books = Book.objects.all()
    for book in books:
        book.link = book.booklink.url
    response = utils.build_obj_from_queryset(books)
    return JsonResponse(response, safe=False)
Beispiel #5
0
def get_tasks(request):
    utils.dump(request.GET)
    # date = datetime.strptime("Tue Oct 20 09:26:38 GMT 2015",  '%a %b %d %H:%M:%S %Z %Y')
    # latest_task_list = Task.objects.all().filter(date=date).order_by('-date')
    latest_task_list = Task.objects.all().filter(
        isDeleted=False).order_by('-date')
    response = utils.build_obj_from_queryset(latest_task_list)
    return JsonResponse(response, safe=False)
Beispiel #6
0
def get_tasks_by_date(request):
    utils.dump(request.GET)
    #todo get with param, not Post
    date_filter = datetime.strptime(request.POST.get('date'),
                                    '%a %b %d %H:%M:%S %Z %Y')
    latest_task_list = Task.objects.all().filter(
        isDeleted=False, date__startswith=date_filter.date()).order_by('-date')
    response = utils.build_obj_from_queryset(latest_task_list)
    return JsonResponse(response, safe=False)
Beispiel #7
0
def get_mottos(request):
    # utils.dump(request.GET)
    mottos = Motto.objects.all()
    response = utils.build_obj_from_queryset(mottos);
    return JsonResponse(response, safe=False)
Beispiel #8
0
def get_unfinished_tasks(request):
    utils.dump(request.GET)
    latest_task_list = Task.objects.all().filter(status=0).order_by('-date')
    response = utils.build_obj_from_queryset(latest_task_list);
    return JsonResponse(response, safe=False)
Beispiel #9
0
def get_deleted_tasks(request):
    utils.dump(request.GET)
    latest_task_list = Task.objects.all().filter(isDeleted=True).order_by('-date')
    response = utils.build_obj_from_queryset(latest_task_list);
    return JsonResponse(response, safe=False)
Beispiel #10
0
def get_mottos(request):
    # utils.dump(request.GET)
    mottos = Motto.objects.all()
    response = utils.build_obj_from_queryset(mottos)
    return JsonResponse(response, safe=False)
Beispiel #11
0
def get_unfinished_tasks(request):
    utils.dump(request.GET)
    latest_task_list = Task.objects.all().filter(status=0).order_by('-date')
    response = utils.build_obj_from_queryset(latest_task_list)
    return JsonResponse(response, safe=False)
Beispiel #12
0
def get_deleted_tasks(request):
    utils.dump(request.GET)
    latest_task_list = Task.objects.all().filter(
        isDeleted=True).order_by('-date')
    response = utils.build_obj_from_queryset(latest_task_list)
    return JsonResponse(response, safe=False)