# HG changeset patch # User ymh # Date 1358856190 -3600 # Node ID 94cca4093b600a89a06eb44a30ca1cae755eafc6 # Parent 66c7a0826bd7c68e6799a43ed6dc99acf9eb4afd add command to sync the iri file, recreating them if necessary diff -r 66c7a0826bd7 -r 94cca4093b60 .settings/org.eclipse.core.resources.prefs --- a/.settings/org.eclipse.core.resources.prefs Tue Jan 22 11:25:55 2013 +0100 +++ b/.settings/org.eclipse.core.resources.prefs Tue Jan 22 13:03:10 2013 +0100 @@ -34,6 +34,7 @@ encoding//src/ldt/ldt/ldt_utils/migrations/0024_auto__chg_field_tag_name.py=utf-8 encoding//src/ldt/ldt/ldt_utils/migrations/0025_chg_site_domain.py=utf-8 encoding//src/ldt/ldt/ldt_utils/views/json.py=utf-8 +encoding//src/ldt/ldt/management/commands/synciri.py=utf-8 encoding//src/ldt/ldt/management/utils.py=utf-8 encoding//src/ldt/ldt/test/test_runner.py=utf-8 encoding//src/ldt/ldt/text/migrations/0001_initial.py=utf-8 diff -r 66c7a0826bd7 -r 94cca4093b60 src/ldt/ldt/management/commands/synciri.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/management/commands/synciri.py Tue Jan 22 13:03:10 2013 +0100 @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +''' +Created on Jan 22, 2013 + +@author: ymh +''' + +from django.core.management.base import NoArgsCommand +from ..utils import show_progress +from ldt.ldt_utils.models import Content + +class Command(NoArgsCommand): + + def handle_noargs(self, **options): + + content_list = list(Content.objects.all()) + writer = None + for i,c in enumerate(content_list): + writer = show_progress(i+1, len(content_list), "Processing content %s" % c.title, 80, writer) + c.sync_iri_file() + \ No newline at end of file