From: Karmaworld Date: Tue, 18 Mar 2014 21:09:06 +0000 (+0000) Subject: update script to be more percise to reduce memory usage X-Git-Tag: release-20150131~144^2~32^2~3 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=593567aec6b25ee1140a83e4017c707bc13c92f8;p=oweals%2Fkarmaworld.git update script to be more percise to reduce memory usage --- diff --git a/karmaworld/apps/notes/management/commands/convert_notes_to_markdown.py b/karmaworld/apps/notes/management/commands/convert_notes_to_markdown.py index 3ab4648..1472ab0 100644 --- a/karmaworld/apps/notes/management/commands/convert_notes_to_markdown.py +++ b/karmaworld/apps/notes/management/commands/convert_notes_to_markdown.py @@ -15,8 +15,7 @@ class Command(BaseCommand): def handle(self, *args, **kwargs): """ On all calls, clean all notes with html and not text using html2text """ - notes = Note.objects.all() - + notes = Note.objects.only('static_html', 'mimetype', 'slug').filter(static_html=True).iterator() converted_notes = 0 for note in notes: if note.static_html and not note.is_pdf():