Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)