ソースを参照

Task Userguide: Fixed inconsistency in examples

Ask Solem 14 年 前
コミット
fed0afa95e
1 ファイル変更2 行追加1 行削除
  1. 2 1
      docs/userguide/tasks.rst

+ 2 - 1
docs/userguide/tasks.rst

@@ -19,10 +19,11 @@ Given a function ``create_user``, that takes two arguments: ``username`` and
 .. code-block:: python
 
     from celery.task import Task
+    from django.contrib.auth import User
 
     class CreateUserTask(Task):
         def run(self, username, password):
-            create_user(username, password)
+            User.objects.create(username=username, password=password)
 
 For convenience there is a shortcut decorator that turns any function into
 a task: