diff --git a/README.rst b/README.rst index 78e2b16..cdcf4dd 100644 --- a/README.rst +++ b/README.rst @@ -114,10 +114,6 @@ Async Use async from your code to quickly offload tasks: -.. code:: python - - async(func,*args,hook=None,**kwargs) - .. code:: python from django_q import async, result @@ -142,6 +138,15 @@ Use async from your code to quickly offload tasks: def print_result(task): print(task.result) +.. code:: python + + async(func,*args,**kwargs) + +- **func**: Function to execute. Dotted string or reference. +- **args**: Optional arguments for the function. +- **hook**: Optional function to call after execution. Dotted string or reference. +- **kwargs**: Optional keyword arguments for the function. + Schedule ^^^^^^^^ @@ -167,6 +172,19 @@ Admin page or directly from your code: schedule_type=Schedule.DAILY ) +.. code:: python + + schedule(func,*args,**kwargs) + +- **func**: the function to schedule. Dotted strings only. +- **args**: arguments for the scheduled function. +- **hook**: optional result hook function. Dotted strings only. +- **schedule_type**: (O)nce, (H)ourly, (D)aily, (W)eekly, M(onthly), Q(uarterly), Y(early) +- **repeats**: Number of times to repeat schedule. -1=Always, 0=Never, n=n. +- **next_run**: Next or first scheduled execution datetime. +- **kwargs**: optional keyword arguments for the scheduled function. + + Models ~~~~~~ - `Task` and `Schedule` are Django Models and can therefore be managed by your own code.