bgneal@95: """ bgneal@95: untextile.py - A command to remove the use of Textile by updating the models. bgneal@95: bgneal@95: """ bgneal@95: import textile bgneal@95: bgneal@95: from django.core.management.base import NoArgsCommand bgneal@95: from photologue.models import Gallery bgneal@95: bgneal@95: bgneal@95: class Command(NoArgsCommand): bgneal@95: help = 'Updates models by un-textiling text fields' bgneal@95: bgneal@95: def handle_noargs(self, **options): bgneal@95: bgneal@95: for gallery in Gallery.objects.all(): bgneal@95: gallery.description = textile.textile(gallery.description, bgneal@95: encoding='utf-8', bgneal@95: output='utf-8') bgneal@95: gallery.save()