]> git.parisson.com Git - timeside.git/commitdiff
begin atomic experience task
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 17 Mar 2015 21:42:19 +0000 (22:42 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 17 Mar 2015 21:42:19 +0000 (22:42 +0100)
timeside/server/tasks.py

index 1ad7db65e67d076aa9fa27c2df563a0599604743..19c60238861318b7cbb5418017444d460795986f 100644 (file)
@@ -1,7 +1,7 @@
 from __future__ import absolute_import
 
 from celery import shared_task
-from .models import Task
+from .models import Item, Selection, Preset, Task
 
 
 @shared_task
@@ -10,6 +10,13 @@ def task_run(id):
     task.run()
 
 
+@shared_task
+def experience_run(experience_id, item_id):
+    item = Item.objects.get(id=item_id)
+    experience = Experience.objects.get(id=experience_id)
+    experience.run(item)
+
+
 @shared_task
 def add(x, y):
     return x + y