Ejemplo n.º 1
0
    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
            bookloader.add_openlibrary(work, hard_refresh=True)
Ejemplo n.º 2
0
def populate_edition(isbn):
    """given an edition this task will populate the database with additional
    information about related editions and subjects related to this edition
    """
    bookloader.add_related(isbn)
    edition = models.Edition.get_by_isbn(isbn)
    if edition:
        bookloader.add_openlibrary(edition.work)
    return edition
Ejemplo n.º 3
0
    def handle(self, **options):
        spam_strings = [
            "1stWorldLibrary.ORG", "GeneralBooksClub.com", "million-books.com",
            "AkashaPublishing.Com"
        ]
        for spam_string in spam_strings:
            qs = models.Work.objects.filter(description__icontains=spam_string)
            print "Number of Works with %s in description: %s" % (spam_string,
                                                                  qs.count())

            for work in qs:
                work.description = bookloader.despam_description(
                    work.description)
                print "updating work %s" % work
                bookloader.add_openlibrary(work, hard_refresh=True)
Ejemplo n.º 4
0
 def handle(self, *args, **options):
     for work in models.Work.objects.filter(
             openlibrary_lookup__isnull=True):
         self.stdout.write("loading openlibrary data for %s" % work)
         bookloader.add_openlibrary(work)