-@task
-def index_book(book_id, book_info=None, **kwargs):
- from catalogue.models import Book
+@shared_task(ignore_result=True)
+def build_field(pk, field_name):
+ book = Book.objects.get(pk=pk)
+ task_logger.info("build %s.%s" % (book.slug, field_name))
+ field_file = getattr(book, field_name)
+ field_file.build()
+
+
+@shared_task
+def index_book(book_id, **kwargs):