2012-07-26 17:39:46 +00:00
|
|
|
from django.core.management.base import BaseCommand
|
2013-06-03 16:31:39 +00:00
|
|
|
|
2012-07-26 17:39:46 +00:00
|
|
|
from regluit.core import models, bookloader
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
help = "do OL relookup if description contains { "
|
|
|
|
|
|
|
|
def handle(self, **options):
|
|
|
|
print "Number of Works with { in description: %s" % models.Work.objects.filter(description__contains='{').count()
|
|
|
|
|
|
|
|
for work in models.Work.objects.filter(description__contains='{'):
|
|
|
|
print "updating work %s" % work
|
2012-07-27 19:58:16 +00:00
|
|
|
bookloader.add_openlibrary(work, hard_refresh = True)
|