From d34b2e486035081fa4a65bcecc097b4af2c4b496 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 22 Feb 2012 17:58:42 +0530 Subject: [PATCH] random 1, update sort after import --- pandora/archive/tasks.py | 1 + pandora/item/tasks.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora/archive/tasks.py b/pandora/archive/tasks.py index 57dc2015..7aa11fe2 100644 --- a/pandora/archive/tasks.py +++ b/pandora/archive/tasks.py @@ -119,6 +119,7 @@ def update_stream(id): s.file.item.update_timeline() #make sure all derivatives exist s.extract_derivatives() + s.file.item.update_sort() #update clips for c in s.file.item.clips.all(): diff --git a/pandora/item/tasks.py b/pandora/item/tasks.py index b3b1c75f..ab22eaf6 100644 --- a/pandora/item/tasks.py +++ b/pandora/item/tasks.py @@ -22,7 +22,7 @@ def update_random_sort(): random.seed() ids = [f['item'] for f in models.ItemSort.objects.values('item')] random.shuffle(ids) - n = 0 + n = 1 for i in ids: models.ItemSort.objects.filter(pk=i).update(random=n) n += 1