2

All,

I've implemented Django-Q and Redis and it works great if I use Django Admin to manage everything. Now I'm ready to reproduce the functionality that Django Admin provides from within my app. I'm able manage a schedule tasks but I can't figure out how to obtain a list of what's been scheduled as well as what has successfully ran and failed.

Any thoughts on how I can access a list of what's been scheduled?

Gary Franks
  • 103
  • 4

1 Answers1

5

I found the answer to my question! I found the database table that Django-Q uses and located the model for it. Below is the snippet I used to display the task list that has already been executed with status.

from django_q.tasks import Task

def task_stat_view(request):
    task_qs = Task.objects.all().order_by('started').reverse()
    context = {"tasks": task_qs}
    return render(request, 'task_list.html',context)
Gary Franks
  • 103
  • 4