From 5812ed096461a1d095014de524612013eabb0874 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 31 Oct 2011 18:50:59 +0100 Subject: [PATCH] 0x does not have external --- pandora/item/management/commands/update_external.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora/item/management/commands/update_external.py b/pandora/item/management/commands/update_external.py index 34959a2e..d58dacf4 100644 --- a/pandora/item/management/commands/update_external.py +++ b/pandora/item/management/commands/update_external.py @@ -28,9 +28,10 @@ class Command(BaseCommand): def handle(self, **options): offset = 0 chunk = options['all'] and 100 or options['items'] - count = pos = models.Item.objects.count() + qs = models.Item.objects.exclude(itemId__startswith='0x') + count = pos = qs.count() while options['all'] and offset <= count or offset < options['items']: - for i in models.Item.objects.all().order_by('modified')[offset:offset+chunk]: + for i in qs.order_by('modified')[offset:offset+chunk]: print pos, i.itemId, i.modified i.update_external() pos -= 1