From ec0a33bfdb734973dfce452102e890825fa304ac Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 2 Nov 2011 15:53:21 +0100 Subject: [PATCH] remove wrint, actually loop over all items --- pandora/api/views.py | 1 - pandora/item/management/commands/update_external.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora/api/views.py b/pandora/api/views.py index aac4b3a8a..3ceaaf0f2 100644 --- a/pandora/api/views.py +++ b/pandora/api/views.py @@ -74,7 +74,6 @@ def init(request): else: response['data']['user'] = response['data']['site']['user'] response['data']['user']['ui'] = get_ui(json.loads(request.session.get('ui', '{}'))) - print request.session, request.session.keys() return render_to_json_response(response) actions.register(init) diff --git a/pandora/item/management/commands/update_external.py b/pandora/item/management/commands/update_external.py index d58dacf45..04070ebb1 100644 --- a/pandora/item/management/commands/update_external.py +++ b/pandora/item/management/commands/update_external.py @@ -30,8 +30,9 @@ class Command(BaseCommand): chunk = options['all'] and 100 or options['items'] 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 qs.order_by('modified')[offset:offset+chunk]: + while (options['all'] and offset <= count) or offset < options['items']: + print offset, pos, count + for i in qs.order_by('modified')[:chunk]: print pos, i.itemId, i.modified i.update_external() pos -= 1