celery.models.rst 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. ===============================
  2. Django Models - celery.models
  3. ===============================
  4. .. data:: TASK_STATUS_PENDING
  5. The string status of a pending task.
  6. .. data:: TASK_STATUS_RETRY
  7. The string status of a task which is to be retried.
  8. .. data:: TASK_STATUS_FAILURE
  9. The string status of a failed task.
  10. .. data:: TASK_STATUS_DONE
  11. The string status of a task that was successfully executed.
  12. .. data:: TASK_STATUSES
  13. List of possible task statuses.
  14. .. data:: TASK_STATUSES_CHOICES
  15. Django choice tuple of possible task statuses, for usage in model/form
  16. fields ``choices`` argument.
  17. .. class:: TaskMeta
  18. Model for storing the result and status of a task.
  19. *Note* Only used if you're running the ``database`` backend.
  20. .. attribute:: task_id
  21. The unique task id.
  22. .. attribute:: status
  23. The current status for this task.
  24. .. attribute:: result
  25. The result after successful/failed execution. If the task failed,
  26. this contains the execption it raised.
  27. .. attribute:: date_done
  28. The date this task changed status.
  29. .. class:: PeriodicTaskMeta
  30. Metadata model for periodic tasks.
  31. .. attribute:: name
  32. The name of this task, as registered in the task registry.
  33. .. attribute:: last_run_at
  34. The date this periodic task was last run. Used to find out
  35. when it should be run next.
  36. .. attribute:: total_run_count
  37. The number of times this periodic task has been run.
  38. .. attribute:: task
  39. The class/function for this task.
  40. .. method:: delay()
  41. Delay the execution of a periodic task, and increment its total
  42. run count.