]> git.parisson.com Git - timeside.git/commitdiff
Fix missing items from sub-selections in timeside.server.models
authorThomas Fillon <thomas@parisson.com>
Thu, 19 Mar 2015 14:26:00 +0000 (15:26 +0100)
committerThomas Fillon <thomas@parisson.com>
Thu, 19 Mar 2015 14:26:10 +0000 (15:26 +0100)
timeside/server/models.py

index 6c08e1fa65c8417812d834f402d1bc6cea5195bc..36226f382989927ee4389418a2ff872391a3a0ff 100644 (file)
@@ -147,6 +147,13 @@ class Selection(DocBaseResource):
         verbose_name = _('selection')
 
 
+    def get_all_items(self):
+        qs_items = self.items.all()
+        for selection in self.selections.all():
+            qs_items |= selection.get_all_items()
+        return qs_items
+
+
 class Item(DocBaseResource):
 
     element_type = 'timeside_item'
@@ -337,8 +344,8 @@ class Task(BaseResource):
 
     def run(self, streaming=False):
         self.status_setter(_RUNNING)
-
-        for item in self.selection.items.all():
+        
+        for item in self.selection. get_all_items():
             item_path = item.get_results_path()
             if not os.path.exists(item_path):
                 os.makedirs(item_path)