from django.conf import settings
from models import EmailJob
from mailer.models import Message

def jobs_running(HttpRequest):
    email_jobs = EmailJob.objects.filter(queued=False).count()
    messages_waiting = Message.objects.count()
    return {'email_jobs': email_jobs, 'messages_waiting': messages_waiting}

