regluit/core/management/commands/add_openlibrary.py

11 lines
352 B
Python
Raw Normal View History

from django.core.management.base import BaseCommand
2013-06-03 16:31:39 +00:00
from regluit.core import models, bookloader
class Command(BaseCommand):
def handle(self, *args, **options):
for work in models.Work.objects.filter(openlibrary_lookup__isnull=True):
print "loading openlibrary data for %s" % work
bookloader.add_openlibrary(work)