File: djcelery.models.rst

package info (click to toggle)
django-celery 3.1.16-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 784 kB
  • ctags: 933
  • sloc: python: 4,082; makefile: 92; sh: 62
file content (79 lines) | stat: -rw-r--r-- 1,784 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
===============================
Django Models - celery.models
===============================

.. contents::
    :local:

.. data:: TASK_STATUS_PENDING

    The string status of a pending task.

.. data:: TASK_STATUS_RETRY
   
    The string status of a task which is to be retried.

.. data:: TASK_STATUS_FAILURE
   
    The string status of a failed task.

.. data:: TASK_STATUS_DONE
   
    The string status of a task that was successfully executed.

.. data:: TASK_STATUSES
   
    List of possible task statuses.

.. data:: TASK_STATUSES_CHOICES
   
    Django tuple of possible values for the task statuses, for usage in
    model/form fields ``choices`` argument.

.. class:: TaskMeta
   
    Model for storing the result and status of a task.
    
    *Note* Only used if you're running the ``database`` backend.

    .. attribute:: task_id

        The unique task id.

    .. attribute:: status

        The current status for this task.

    .. attribute:: result
        
        The result after successful/failed execution. If the task failed,
        this contains the execption it raised.

    .. attribute:: date_done

        The date this task changed status.

.. class:: PeriodicTaskMeta
   
    Metadata model for periodic tasks.

    .. attribute:: name
       
        The name of this task, as registered in the task registry.

    .. attribute:: last_run_at

        The date this periodic task was last run. Used to find out
        when it should be run next.

    .. attribute:: total_run_count
       
        The number of times this periodic task has been run.

    .. attribute:: task
       
        The class/function for this task.

    .. method:: delay()
        Delay the execution of a periodic task, and increment its total
        run count.