- @staticmethod
- def zip_pdf():
- books = Book.objects.all()
-
- paths = filter(lambda x: x is not None,
- map(lambda b: b.pdf_file and b.pdf_file.path or None, books))
- result = create_zip_task.delay(paths, settings.ALL_PDF_ZIP)
- return result.wait()
-
- @staticmethod
- def zip_mobi():
- books = Book.objects.all()
-
- paths = filter(lambda x: x is not None,
- map(lambda b: b.mobi_file and b.mobi_file.path or None, books))
- result = create_zip_task.delay(paths, settings.ALL_MOBI_ZIP)
- return settings.MEDIA_URL + result.wait()
-