Browse Source

Looks cleaner to import ``tasks`` from celery.registry rather from celery.task

Ask Solem 16 years ago
parent
commit
580a2a1fd5
2 changed files with 4 additions and 2 deletions
  1. 4 2
      README.rst
  2. 0 0
      celery/task/__init__.py

+ 4 - 2
README.rst

@@ -237,7 +237,8 @@ advanced features of celery later.
 This is a task that basically does nothing but take some arguments,
 and return a value:
 
-    >>> from celery.task import Task, tasks
+    >>> from celery.task import Task
+    >>> from celery.registry import tasks
     >>> class MyTask(Task):
     ...     name = "myapp.mytask"
     ...     def run(self, some_arg, **kwargs):
@@ -296,7 +297,8 @@ Periodic Tasks
 Periodic tasks are tasks that are run every ``n`` seconds. 
 Here's an example of a periodic task:
 
-    >>> from celery.task import tasks, PeriodicTask
+    >>> from celery.task import PeriodicTask
+    >>> from celery.registry import tasks
     >>> from datetime import timedelta
     >>> class MyPeriodicTask(PeriodicTask):
     ...     name = "foo.my-periodic-task"

+ 0 - 0
celery/task.py → celery/task/__init__.py