regluit/core/management/commands/add_openlibrary.py

11 lines
352 B
Python

from django.core.management.base import BaseCommand
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)