mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-19 02:48:16 +08:00
27 lines
580 B
Python
27 lines
580 B
Python
from django_q.models import Task
|
|
from django_q.core import async
|
|
|
|
default_app_config = 'django_q.apps.DjangoQConfig'
|
|
|
|
|
|
def result(name):
|
|
"""
|
|
Returns the result of the named task
|
|
:type name: str or unicode
|
|
:param name: the task name
|
|
:return: the result object of this task
|
|
:rtype: object or str
|
|
"""
|
|
return Task.get_result(name)
|
|
|
|
|
|
def get_task(name):
|
|
"""
|
|
Returns the processed task
|
|
:param name: the task name
|
|
:type name: str or unicode
|
|
:return: the full task object
|
|
:rtype: Task
|
|
"""
|
|
return Task.objects.get(name=name)
|