소스 검색

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

Ask Solem 16 년 전
부모
커밋
580a2a1fd5
2개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  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,
 This is a task that basically does nothing but take some arguments,
 and return a value:
 and return a value:
 
 
-    >>> from celery.task import Task, tasks
+    >>> from celery.task import Task
+    >>> from celery.registry import tasks
     >>> class MyTask(Task):
     >>> class MyTask(Task):
     ...     name = "myapp.mytask"
     ...     name = "myapp.mytask"
     ...     def run(self, some_arg, **kwargs):
     ...     def run(self, some_arg, **kwargs):
@@ -296,7 +297,8 @@ Periodic Tasks
 Periodic tasks are tasks that are run every ``n`` seconds. 
 Periodic tasks are tasks that are run every ``n`` seconds. 
 Here's an example of a periodic task:
 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
     >>> from datetime import timedelta
     >>> class MyPeriodicTask(PeriodicTask):
     >>> class MyPeriodicTask(PeriodicTask):
     ...     name = "foo.my-periodic-task"
     ...     name = "foo.my-periodic-task"

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